Git merge - when you know you want changes from main

The solution is easy, just take the changes from the other branch.

git merge -X theirs other-branch

Wait - but how do you know what changes are incoming, ie. where is the conflict?

You could just try out

git merge other-branch

Some conflicts here, but I DO want to solve the conflicts by taking their changes.

git merge --abort
git merge -X theirs other-branch

All articles


Comments

No published comments yet.


Add a Comment

Your comment is held for review before it appears publicly.

Your email is never published or shared.

Up to 2,000 characters.

Tick the box, then click Submit right away (Google expires the check after about two minutes).