[ACCEPTED]-Git merging theirs steps-merge

Accepted answer
Score: 41

If your goal is indeed to keep one version 14 or the other, then yes, you will want to 13 use:

git checkout <--theirs|--ours> <path>
git add <path>

Of course, as you say, it's not ideal. If 12 there's any way you can avoid this, you 11 should. If you can, try to adopt workflow 10 habits which avoid changing those files 9 on divergent branches which will later need 8 to be merged. If the files are generated 7 from tracked content, you really probably 6 do want to ignore them - if you have good 5 reason not to, you might want to generate 4 them from the mergeable tracked content 3 instead, if that's possible.

So, explore 2 all your other options before doing this, but 1 if you must, you've got it right.

Score: 2

Look into using .gitignore to ignore generated 1 files. You may have to do git rm as well.

More Related questions