Skip to content

Instantly share code, notes, and snippets.

@dmoulton
Created August 17, 2011 17:17
Show Gist options
  • Save dmoulton/1152058 to your computer and use it in GitHub Desktop.
Save dmoulton/1152058 to your computer and use it in GitHub Desktop.
How to combine git repositories into one
Steps to combine multiple git repos into one
0. Make sure all repos you are moving are checked in and backed up
1. cd projects/project1
2. mkdir proj
3. git mv * proj/ #will error when copying project1 directory to itself
4. git commit -m "about to migrate to new repo"
repeat 1 - 4 for other repos you want to combine
5. cd back to projects
6. mkdir new_meta_repo
7. cd new_meta_repo
8. git init
9. git pull ../project1/proj
repeat 5 - 9 for other projects
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment