O'Reilly logo

Mastering Vim by Ruslan Osipov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Resolving a merge conflict

Start the Git merge tool (which is vimdiff, since we configured it earlier):

$ git mergetool

You will be treated to quite a light show, with four windows and a lot of colors thrown at you:

It's okay to be scared, but it's not as terrifying as it looks.

Local changes (master branch in this case) are in the upper-left window, followed by a closest common ancestor and the create-animal branch in the upper-right corner. The result of the merge is in the bottom window.

To get into more detail, from left to right, top to bottom:

  • LOCAL: This is file from the current branch (or whatever you're merging into)
  • BASE: 

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required