Skip to content

Instantly share code, notes, and snippets.

@blpabhishek
Created July 31, 2017 11:52
Show Gist options
  • Save blpabhishek/cf1de2d596925ba2405a30fedb881181 to your computer and use it in GitHub Desktop.
Save blpabhishek/cf1de2d596925ba2405a30fedb881181 to your computer and use it in GitHub Desktop.
Merge two unrelated git repositories
# merge project-a to a project-b with all the history
cd path/to/project-b
git remote add project-a path/to/project-a
git fetch project-a
git merge --allow-unrelated-histories project-a/master
git remote remove project-a
git add .
git commit -m <message>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment