Skip to Content

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!

many git disasters are caused by accidentally running a command while on the wrong branch…

Illustration of a stick figure with a neutral expression.

person: git commit

person, thinking: UGH I didn’t mean to do that on main

… or by forgetting you’re in the middle of a multistep operation

smiling stick figure with curly hair: la la la just writing code

same person, now distressed and surrounded by exclamation marks: OMG I FORGOT I WAS IN THE MIDDLE OF A MERGE CONFLICT

I always keep track of 2 things

  1. am I on a branch, or am I in detached HEAD state?
  2. am I in the middle of some kind of multistep operation? (rebase, merge, bisect, etc)

I keep my current branch in my shell prompt

~/work/homepage (main) $

to me it’s as important as knowing what directory I’m in

git comes with a script to do this in bash/zsh called

decoder ring for the default git shell prompt


on a branch, everything is normal


the double brackets (( )) mean detached HEAD state. this prompt can only happen if you explicitly git checkout a commit/tag/remote-tracking branch

(main|REBASE 1/1)

in the middle of a cherry-pick/rebase/merge/bisect

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)