Skip to content

Instantly share code, notes, and snippets.

@farhad0085
Created August 30, 2024 19:57
Show Gist options
  • Save farhad0085/052d0ffe553a71fd8239ed818a51c4e9 to your computer and use it in GitHub Desktop.
Save farhad0085/052d0ffe553a71fd8239ed818a51c4e9 to your computer and use it in GitHub Desktop.
Merge two Git repositories

If you want to merge branch branchX from projectA into projectB:

cd path/to/projectA
git checkout branchX
cd path/to/projectB
git remote add projectA /path/to/projectA
git fetch projectA --tags
git merge --allow-unrelated-histories projectA/branchX
git remote remove projectA

Thanks to this answer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment