Skip to Content
Navigation:

A stick figure smiling

Here's a preview from my zine, Oh Shit! Git!! If you want to see more comics like this, sign up for my saturday comics newsletter or browse more comics!

Image of a comic. To read the full HTML alt text, click "read the transcript". get the zine!
read the transcript!

Suppose you had main checked out and ran git merge feature-branch.

If that causes a merge conflict, you’ll see something like this in the files with conflicts:

<<<<<<< HEAD
if x == 0:
   return false
=======

(this is the code from main)

if y == 6:
   return true
elif x ==0:
   return false
feature-branch
>>> d34367

(this is the code from feature-branch)

To resolve the conflict:

  1. Edit the files to fix the conflict
  2. git add the fixed files
  3. git diff –check: check for more conflicts.
  4. git commit when you’re done. (or git rebase --continue if you’re rebasing!)

Smiling stick figure with medium length straight hair: You can use a GUI to visually resolve conflicts with git mergetool. Meld (meldmerge.org) is a great choice!