Last Updated: October 04, 2020
·
15.38K
· zbrox

Choose local or remote version in a merge conflict

From Git version 1.6.1 there are --ours and --theirs options for keeping only the local or remote version of a file with a merge conflict.

git checkout --ours <file_name>
git checkout --theirs <file_name>

Really simple to use!

Related protips:

fatal: refusing to merge unrelated histories