Skip to Content
Cover for How Git Works

How Git Works

If you’re still perplexed by git even though you’ve been using it for years, this zine is for you!

Git has a bad reputation: it’s easy to accidentally lose your work or put your repository into a difficult-to-recover state, the terminology is arcane (detached HEAD state? reference? fast-forward? remote-tracking branch?), and the man pages are legendary for how inscrutable they are.

It’s no surprise that many people stay in their comfort zone: you might have a set of 6 git commands that work for you, and hope that nothing goes wrong.

But my experience is that after learning how git’s design choices work, it’s way easier to:

  • confidently handle diverged git branches, so you can work with others with no stress
  • recognize bad git situations, so you can quickly get out of them and move on
  • understand git’s underlying logic, so that messages like “you’re in detached HEAD state” are totally routine to deal with
  • know how git stores your history, so when you lose a commit you can always get it back

This zine explains git’s core concepts (commits! branches! merging! remotes!) with minimal jargon and a focus on the actual problems that can ruin your day. What does fast-forward failed mean? What’s “detached HEAD state” and what are you supposed to do about it? Why do commits sometimes get lost, and how can you get them back?

I want this!

People love this zine!

Dara MacConville

Certainly the easiest and nicest experience I've had learning about git.

Joseph Ganley

Despite using Git for many years, I've never understood it thoroughly enough to form a good mental model that would allow me to really grok what's going on. Now, thanks to this zine, I get it.

Steven Holland

I learned something on nearly every page. It's also made me more comfortable poking around the internals of .git and more confident that in most cases I'm not going to lose my work, which has been my biggest fear.

Andrew Zeigert

I've been using git daily for years, but I was a classic "I know 5 commands and I'm fine" person. I've always wanted to understand git on a more technical level and this guide offers an excellent balance of depth and clarity. Thanks!

Wolf W.

I've been using Git for almost 15 years and there was still stuff for me to learn here. I was most thrilled by push.autoSetupRemote!

Reviews

Write a review!
Loading reviews...

Credits!

  • Cover art by Vladimir Kašiković
  • Copy editing by Gersande La Flèche
  • Pairing: Marie Claire LeBlanc Flanagan
  • Technical review by James Coglan

Commonly asked questions:

what's a zine?

According to Wikipedia:

A fanzine (blend of fan and magazine or -zine) is a non-professional and non-official publication produced by enthusiasts of a particular cultural phenomenon (such as a literary or musical genre) for the pleasure of others who share their interest.

The zines on this site are usually about 20 pages, and they’re full of short, informative, and fun comics which will quickly teach you something useful.

who are these zines for?

They’re aimed at working programmers, like me! The idea is that you’re busy, you want to know how to use some computer thing, and the man page makes your head hurt.

is the PDF version printable?

Yes! The PDF version of the zine includes special PDFs designed to be easy printable on a home printer. Print it out, staple it, fold it, read it, and then give it to a friend! It turns out it’s way easier to convince your friends to read a physical thing that is in front of them.

They all have black & white version to make sure they print well if you only have a black & white printer.

Table of Contents:

Take a peek inside: