Consider that you a have git repository with subfolders:
firstFoldersecondFolderthirdFolder- ...
and the repository has multiple branches:
firstBranchsecondBranchthirdBranch- ...
And you want to turn, for example, the firstFolder and its clones/mirrors across different branches into an independent repository. This is the equivalent of git checkout to every one of those branches and git rm -r the other folders and then git mv the content of that specific folder to the main folder. But I was wondering if there is a more canonical way to do this? One solution would be writing a script to list all the branches and repeat these steps across those; I thought maybe there is a git solution to this.