Skip to content

Instantly share code, notes, and snippets.

@canton7
Last active October 18, 2016 19:40
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save canton7/1268587 to your computer and use it in GitHub Desktop.
git merge -s theirs

How to do a git merge -s theirs

One way of many...

This is one way which keeps the history looking like you'd expect.

Command is equivalent to git checkout MINE; git merge -s theirs HERS.

git checkout MINE
git merge --no-commit -s ours HERS
git rm -rf .
git checkout HERS -- .
git commit

From http://www.seanius.net/blog/2011/02/git-merge-s-theirs/

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