Skip to Content
Navigation:

A stick figure smiling

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".

browse more comics! get the zine!
read the transcript!

when pushing/pulling, the hardest problems are caused by diverged branches

sad error messages:

! [rejected]     
main -> main

(non fast-forward)

fatal: Not possible to fast-forward, aborting

fatal: Need to specify how to reconcile divergent branches.

what are diverged branches

it looks like this:

Diagram with two blank boxes, followed by a box with a heart in it, that then branches out into two branches, one with a hash symbol in it, labelled “local main”, and one with a squiggle in it, labelled “remote main”.

there are 4 possibilities with a remote branch

  1. up to date (with a heart)
    Illustration of three boxes in a row, labelled both “local” and “remote”

  2. need to pull
    Illustration of four boxes in a row. The second box in the sequence is labelled “local”, the fourth branch is labelled “remote”.

  3. need to push
    Illustration of four boxes in a row. The second box in the sequence is labelled “remote”, the fourth branch is labelled “local”.

  4. diverged (need to decide how to solve it) (sad face)
    Illustration of two boxes in a row, that then branches out into two branches. One of the branches has one box, labelled “remote”, and the other branch has two boxes, labelled “local”.

how to tell your branches have diverged: git status

  1. $ git fetch (get the latest remote state first)
  2. $ git status Your branch and ‘origin/main’ have diverged, and have 1 and 1 different commits each, respectively.

(use “git pull” to merge the remote branch into yours)

(diverged is highlighted)

fix diverged branches before making more commits

First illustration: two boxes in a row, then branches out into two branches, each with one box. It’s labelled “not so bad to resolve…”

Second illustration: two boxes in a row, then branches out into two branches, but each branch has a whole bunch of boxes.

Illustration of a sad stick figure with curly hair.

person: oh no

there’s no one solution

Illustration of a smiling stick figure with curly hair.

person: on the next page we’ll talk about some options!

Saturday Morning Comics!

Want another comic like this in your email every Saturday? Sign up here!

I'll send you one of my favourite comics from my archives every Saturday.
© Julia Evans 2024 | All rights reserved (see the FAQ for notes about licensing)