Created
May 29, 2012 15:53
-
-
Save magnusdahlstrand/2829187 to your computer and use it in GitHub Desktop.
Import git repo into another repo while keeping the history of both.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//From http://stackoverflow.com/a/8396318/657977 | |
Switch [NAME] for whatever name you want to call it | |
Switch [PATH or URL] for the path or url to the repo you want to include. | |
git remote add [NAME]_remote [PATH or URL] | |
git fetch [NAME]_remote | |
git merge -s ours --no-commit [NAME]_remote/master | |
git read-tree --prefix=[NAME]/ -u [NAME]_remote/master | |
git commit -m "Imported [NAME] as a subtree." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment