Skip to content

Instantly share code, notes, and snippets.

@tobyhede
Created April 11, 2011 05:31
Show Gist options
  • Save tobyhede/913103 to your computer and use it in GitHub Desktop.
Save tobyhede/913103 to your computer and use it in GitHub Desktop.
Merge one git repo into another, keeping the commit history
git remote add -f {name} {path}
git merge -s ours --no-commit {name}/master
git read-tree --prefix={local-path}/ -u {name}/master
git commit -m "merge {name}"

git remote add -f coursesearch-404 git@github.com:marcom-unimelb/coursesearch-404.git
git merge -s ours --no-commit coursesearch-404/master
git read-tree --prefix=coursesearch-404/ -u coursesearch-404/master
git commit -m "merge coursesearch-404"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment