![]() This is the only non-obvious part of the whole operation. Git merge -s recursive -Xsubtree=old_a old_a/feature-in-progress # Bring over a feature branch from one of the old repos If we have in-progress feature branches in the old repositories that also need to come over to the new repository, that’s also quite easy: Obviously you could instead merge old_b into old_a (which becomes the new combined repo) if you’d rather do that – modify the script to suit. (Since we did a rename, you have to do “git log –follow ” to see that history, but that’s true for any file rename operation, not just for our repo-merge.) Now we have all the files from OldA and OldB in repository New, sitting in separate subdirectories, and we have both the commit history and the individual file history for all files. Git commit -m “Move old_b files into subdir” # Move the old_a repo files and folders into a subdirectory so they don’t collide with the other repo coming laterĭir –exclude old_a | % # Clean up our dummy file because we don’t need it any more # Merge the files from old_a/master into new/master # Add a remote for and fetch the old repo # Before we do a merge, we have to have an initial commit, so we’ll make a dummy commit # Assume the current directory is where we want the new repository to be created
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |