Created
August 3, 2014 02:57
-
-
Save purwa-astawa/dcfa4e9a0255888c0494 to your computer and use it in GitHub Desktop.
adding subtree to a repo
https://help.github.com/articles/about-git-subtree-merges
This file contains 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
#Add a new remote URL pointing to the separate project that we're interested in. | |
git remote add -f spoon-knife git@github.com:octocat/Spoon-Knife.git | |
#Merge the Spoon-Knife project into the local Git project | |
git merge -s ours --no-commit spoon-knife/master | |
#Create a new directory called spoon-knife, and copy the Git history of the Spoon-Knife project into it. | |
git read-tree --prefix=spoon-knife/ -u spoon-knife/master | |
#Commit the changes to keep them safe. | |
git commit -m "Subtree merged in spoon-knife" | |
#to update the subtree | |
git pull -s subtree spoon-knife master | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment