Fakultativ Parasit
Fakultativ Parasit

Reputation: 46

VimDiff as Git MergeTool : How To resolve all merge conflicts with changes from LOCAL,BASE or REMOTE with one command?

I want to know : How To resolve all merge conflicts with changes from LOCAL,BASE or REMOTE with one command ? This must be possible right ? I am struggling with this for 2 hours now....

Or is there even a possibility without vimdiff ?

thank you

Upvotes: 1

Views: 626

Answers (2)

vaudt
vaudt

Reputation: 181

You can try this on the vimdiff prompt g/<<< HEAD/diffg LO Theoretically like this you always grab the LOCAL changes wherever there is a merge conflict. Don't know if it always works, but it'll get you a long way.

Upvotes: 0

joanis
joanis

Reputation: 12290

When you launch git mergetool, 4 filse are created for vimdiff to view:

  • filename_BASE_suffix
  • filename_LOCAL_suffix
  • filename_REMOTE_suffix
  • filename_BACKUP_suffix

With vimdiff still running, if one of these files is the one you want to keep, you can go to your shell and do, say, cp filename_LOCAL_suffix filename, and then go back to vimdiff where you can reload the file (if prompted) or just exit without saving anything.

Upvotes: 1

Related Questions