See this question: Detach (move) subdirectory into separate Git repository
How can we achieve the same end result, but preserving multiple branches from the source repository? For example if the source repository is using Git Flow then we may want to migrate commits that exist on both the master
and develop
branches. If there are any long-life feature-
branches then these need to be migrated into the target repository too.
It appears that all examples of using git subtree
to move a subdirectory into a new repo involve moving all the commits relating to the subdirectory from the current branch (e.g. master
) onto a new branch. I'm trying to get all of the commits from several branches onto several new branches. Is this possible without a lot of pain?