Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Goal

  • You start with the simplest case: a merge conflict.
  • You see in practice what it means that conflicts are not blocking.
  • You learn how to read the conflict markers.
  • And, ultimately, how to solve the conflict.

Focus on the Changes:

○  nz        merge-b
│ ○  m         merge-a
├─╯
○  vr       Base of merge-a and merge-b
│
~

They have vr as their shared base. vr contains a text file with some Lorem Ipsum lines. Among them, you'll find the line:

We will create a conflict here.

If you inspect m / merge-a:

jj show m

you see that it edits exactly that line, adding:

: merge-a added this text.

By the way: you can also reference m using the bookmark merge-a. Bookmarks are equivalent to Git's branches.
The Change nz / merge-b does the same, only with the text:

: merge-b added this text.

Since the two changes are incompatible, merging them will certainly result in a conflict.
Exactly what we want!