I have been following the Answers to this question Detach subdirectory into separate Git repository and had some good successes with simple Subdirectories that are only on one branch but now I am confronted with a Subdirectory that is littered over multiple branches so a simple
git filter-branch --subdirectory-filter SUBDIRECTORY HEAD
does not do the job.
Do I have to switch into each and every branch and run the filter-branch command or is there something that can do a blanked change through the complete history ?
The
HEADat the end of your command is specifying the ref to process. You can give it any number of other commands, including--allto specify absolutely everything,--branchesto specify just branches, or--remotesto specify just remotes. You may have to prefix these options with--to tell filter-branch that these are rev-list args. Note that--allwill try to process tags explicitly, which may not be what you want. You could use--branches --remotesto specify all non-tag refs instead. You may also want to add--tag-name-filter catto rewrite tags that point to rewritten commits – your original command will leave those tags unchanged.