Skip to content

Instantly share code, notes, and snippets.

@alexgorbatchev
Created September 7, 2014 16:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexgorbatchev/5d50a1fad1b6acb924c6 to your computer and use it in GitHub Desktop.
Save alexgorbatchev/5d50a1fad1b6acb924c6 to your computer and use it in GitHub Desktop.
Merge one git repo into another preserving history
#!/bin/bash
other_project=$1
git remote add -f $other_project ../$other_project
git merge -s ours --no-commit $other_project/master
git read-tree --prefix=$other_project -u $other_project/master
git commit -m "Merged $other_project"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment