Skip to content

Instantly share code, notes, and snippets.

@ntcho
Created October 9, 2017 15:48
Show Gist options
  • Save ntcho/6d7cceecd2dad459b01af62fa75e3bc7 to your computer and use it in GitHub Desktop.
Save ntcho/6d7cceecd2dad459b01af62fa75e3bc7 to your computer and use it in GitHub Desktop.
Merging git repositories
// at the copying repo
// move the files into another folder to prevent merge conflicts
git add .
git commit -m "Project move in progress"

// on the destionation repo
// the name `temp` could be changed for anything else
// locations are like in the shell, but the `\` should be replaced to `/`
git remote add temp *location*
git fetch temp
// merge the changes
git merge --allow-unrelated-histories temp/master
// remove the added remote temp
git remote remove temp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment