Skip to content

Instantly share code, notes, and snippets.

@purwa-astawa
Created August 3, 2014 02:57
Show Gist options
  • Save purwa-astawa/dcfa4e9a0255888c0494 to your computer and use it in GitHub Desktop.
Save purwa-astawa/dcfa4e9a0255888c0494 to your computer and use it in GitHub Desktop.
#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