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!

HEAD is a tiny file that just contains the name of your current branch

ref: refs/heads/main

HEAD can also be a commit ID, that’s called “detached HEAD state”


a branch is stored as a tiny file that just contains 1 commit ID. It’s stored in a folder called refs/heads.

7622629 - (actually 40 characters)

tags are in refs/tags, the stash is in refs/stash


a commit is a small file containing its parent(s), message, tree, and author


tree c4e6559 
parent 037ab87 
author Julia <> 1697682215 
committer Julia <> 1697682215 
commit message goes here 

these are compressed, the best way to see objects is with git cat-file -p HASH


trees are small files with directory listings. The files in it are called “blobs”


100644 blob e351d93 404.html 
100644 blob cab4165
040000 tree 9de29f7 lib

the permissions here LOOK like unix permissions, but they’re actually super restricted, only 644 and 755 are allowed


blobs are the files that contain your actual code

print("hello world!!!!")


the reflog stores the history of every branch, tag, and HEAD


2028ee0 c1f9a4c 
Julia Evans <> 
commit: no ligatures in code

each line of the reflog has: - before/after commit IDs - user + - timestamp - log message

remote-tracking branches

remote-tracking branches store the most recently seen commit ID for a remote branch


when git status says “you’re up to date with origin/main”, it’s just looking at this


.git/config is a config file for the repository. it’s where you configure your remotes


[remote "origin"] 
url = jvns/int-exposed 
fetch = +refs/heads/*: refs/remotes/origin/* 
[branch "main"] 
remote = origin 
merge refs/heads/main

git has and local global settings, the local settings are here and the global ones are in ~/.gitconfig


hooks are optional scripts that you can set up to run (eg before a commit) to do anything you want



the staging area

the staging area stores files when you’re preparing to commit

(binary file)

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)