git, block by block

Animated walkthroughs of what git commands actually do. Commits are blocks that never move; branches are tags that do. Watch each command play out step by step — then open the sandbox and type the commands yourself.

A companion to Redstone University — the same block language that renders a CS course out of Minecraft, aimed at git. Taking the course and new to version control? Start here, then head back.

live — rebase playing itself on a loop. every animation on this site runs like this.

Start here

  1. commits & branchesthe grammar: snapshots, pointers, HEAD
  2. fast-forwardthe simplest "merge" — a pointer slides
  3. mergeone new commit with two parents
  4. rebasereplay, not move — and the golden rule
  5. the sandboxtype the commands yourself, watch the blocks

The sandbox

$ git switch -c feature
Switched to a new branch 'feature'
$ git rebase main
An open-ended repo with a real terminal — every command animates the blocks above it, and share copies a link that replays your whole session, typed out, on a loop.
Open it ▸

How to read the blocks

Blocks are commits. They never move, ever — every command that seems to move commits actually makes copies.
mainTags are refs. A branch is a movable name pointing at one commit; the red HEAD tag is where you're standing.
The torch is a change in flight — a commit's diff being replayed somewhere new (rebase, cherry-pick, revert…).
Dashed means not-quite-here: faint sketches show where new commits will land; ghosts are abandoned commits the reflog still remembers.
Wires point at parents. History is walked backwards — a commit knows where it came from, never what comes next.

All the animations