How to override conflicts and take your version

This is part of the Semicolon&Sons Code Diary - consisting of lessons learned on the job. You're in the git category.

Last Updated: 2021-05-15

Sometimes in git, you pull and find there are tons of merge conflicts - even though you know your branch is strictly correct. How to deal with this?

First abort the whole merge with:

git merge --abort

Then repull with that strategy to accept "ours"

git pull -X ours

In addition there is -X theirs