How to Read Visualizations

Every visualization is driven by a Git simulator whose output is verified against real Git. Here is what each part of the stage means — and a live one to try it on.

Live example: git commit

Press ▶ and watch a file travel from your disk to Staging to a commit. To type your own commands, open the Playground.

YOUR FILES — ONE FILE, THREE PLACESWorking diryour diskStagingnext commitHEADlast commitadd ›commit ›GITUALIZEYOUR REPOSITORY — .git on your laptop2e039acAdd homepage2e039ac897849007af489a58ee9eec107a21974e Add homepageb272b3aSet up projectb272b3abaca08f2f1c56c0562679f66a61035535 Set up project129c2dbInitial commit129c2db06bfe68f8469dc82e6e05d1c03d1f768c Initial commitmainmain: a movable label on a commitHEADHEAD → the branch you are onREADME.mdunchangedapp.jsunchangedindex.htmlunchangedv1v1v1v1v1v1v2v2v2HEAD → main → 2e039ac “Add homepage”
0.0s / 66s
commitring = the commit HEAD is onunreachable (still exists)branch = movable labelorigin/* = your bookmark of the remoteHEAD = where you are

1 Your files — one file, three places

The table on the left follows every file through the three places Git keeps it. A version label (v1, v2…) changes when the content changes, and a cell flashes when a command touches it.

YOUR FILES — ONE FILE, THREE PLACESWorking diryour diskStagingnext commitHEADlast commitadd ›commit ›GITUALIZEYOUR REPOSITORY — .git on your laptop2e039acAdd homepage2e039ac897849007af489a58ee9eec107a21974e Add homepageb272b3aSet up projectb272b3abaca08f2f1c56c0562679f66a61035535 Set up project129c2dbInitial commit129c2db06bfe68f8469dc82e6e05d1c03d1f768c Initial commitmainmain: a movable label on a commitHEADHEAD → the branch you are onREADME.mdunchangedapp.jsstagedindex.htmlmodifiedlogin.jsuntrackedv1v1v1v2v2v1v3v2v2v1——HEAD → main → 2e039ac “Add homepage”

Working dir

The file on your disk — what your editor shows. Edits land here first.

YOUR FILES — ONE FILE, THREE PLACESWorking diryour diskStagingnext commitHEADlast commitadd ›commit ›GITUALIZEYOUR REPOSITORY — .git on your laptop2e039acAdd homepage2e039ac897849007af489a58ee9eec107a21974e Add homepageb272b3aSet up projectb272b3abaca08f2f1c56c0562679f66a61035535 Set up project129c2dbInitial commit129c2db06bfe68f8469dc82e6e05d1c03d1f768c Initial commitmainmain: a movable label on a commitHEADHEAD → the branch you are onREADME.mdunchangedapp.jsstagedindex.htmlmodifiedlogin.jsuntrackedv1v1v1v2v2v1v3v2v2v1——HEAD → main → 2e039ac “Add homepage”

Staging

The draft of your next commit. git add copies a version here.

YOUR FILES — ONE FILE, THREE PLACESWorking diryour diskStagingnext commitHEADlast commitadd ›commit ›GITUALIZEYOUR REPOSITORY — .git on your laptop2e039acAdd homepage2e039ac897849007af489a58ee9eec107a21974e Add homepageb272b3aSet up projectb272b3abaca08f2f1c56c0562679f66a61035535 Set up project129c2dbInitial commit129c2db06bfe68f8469dc82e6e05d1c03d1f768c Initial commitmainmain: a movable label on a commitHEADHEAD → the branch you are onREADME.mdunchangedapp.jsstagedindex.htmlmodifiedlogin.jsuntrackedv1v1v1v2v2v1v3v2v2v1——HEAD → main → 2e039ac “Add homepage”

HEAD

The version in the last commit of the branch you are on.

YOUR FILES — ONE FILE, THREE PLACESWorking diryour diskStagingnext commitHEADlast commitadd ›commit ›GITUALIZEYOUR REPOSITORY — .git on your laptop2e039acAdd homepage2e039ac897849007af489a58ee9eec107a21974e Add homepageb272b3aSet up projectb272b3abaca08f2f1c56c0562679f66a61035535 Set up project129c2dbInitial commit129c2db06bfe68f8469dc82e6e05d1c03d1f768c Initial commitmainmain: a movable label on a commitHEADHEAD → the branch you are onREADME.mdunchangedapp.jsstagedindex.htmlmodifiedlogin.jsuntrackedv1v1v1v2v2v1v3v2v2v1——HEAD → main → 2e039ac “Add homepage”

Status line

Under each file name: unchanged, modified, staged, untracked, conflict… exactly what git status would say.

2 The commit graph

The right side draws your repository. Everything on it comes from the real state after each command — nothing is placed by hand.

YOUR FILES — ONE FILE, THREE PLACESWorking diryour diskStagingnext commitHEADlast commitadd ›commit ›GITUALIZEYOUR REPOSITORY — .git on your laptop2e039acAdd homepage2e039ac897849007af489a58ee9eec107a21974e Add homepageb272b3aSet up projectb272b3abaca08f2f1c56c0562679f66a61035535 Set up project129c2dbInitial commit129c2db06bfe68f8469dc82e6e05d1c03d1f768c Initial commitmainmain: a movable label on a commitHEADHEAD → the branch you are onREADME.mdunchangedapp.jsstagedindex.htmlmodifiedlogin.jsuntrackedv1v1v1v2v2v1v3v2v2v1——HEAD → main → 2e039ac “Add homepage”

Circle

One commit, with its short hash and message. Hashes are real: they are computed from the content.

YOUR FILES — ONE FILE, THREE PLACESWorking diryour diskStagingnext commitHEADlast commitadd ›commit ›GITUALIZEYOUR REPOSITORY — .git on your laptop16a965cMerge feature…16a965c6f96f4a7acb902f45bf46455f09ccff30 Merge feature/logina2b8b5dDocument inst…a2b8b5df5d4f38ac299e9b25e95ebcc998bfb7fa Document install2e039acAdd homepage2e039ac897849007af489a58ee9eec107a21974e Add homepageb272b3aSet up projectb272b3abaca08f2f1c56c0562679f66a61035535 Set up project129c2dbInitial commit129c2db06bfe68f8469dc82e6e05d1c03d1f768c Initial commit960123aCall login on…960123a1d58a1488381355be004d5a6ff601640c Call login on load19d2019Add login page19d2019870aaae1bc0c6d1a5aa8cc1f8d76c6473 Add login pagefeature/loginfeature/login: a movable label on a commitmainmain: a movable label on a commitHEADHEAD → the branch you are onREADME.mdunchangedapp.jsunchangedindex.htmlunchangedlogin.jsunchangedv2v2v2v2v2v2v2v2v2v1v1v1HEAD → main → 16a965c “Merge feature/login”

Line

Points from a parent to its child. A merge commit has two parents, so two lines meet.

YOUR FILES — ONE FILE, THREE PLACESWorking diryour diskStagingnext commitHEADlast commitadd ›commit ›GITUALIZEYOUR REPOSITORY — .git on your laptopa2b8b5dDocument installa2b8b5df5d4f38ac299e9b25e95ebcc998bfb7fa Document install2e039acAdd homepage2e039ac897849007af489a58ee9eec107a21974e Add homepageb272b3aSet up projectb272b3abaca08f2f1c56c0562679f66a61035535 Set up project129c2dbInitial commit129c2db06bfe68f8469dc82e6e05d1c03d1f768c Initial commit960123aCall login on lo…960123a1d58a1488381355be004d5a6ff601640c Call login on load19d2019Add login page19d2019870aaae1bc0c6d1a5aa8cc1f8d76c6473 Add login pagemainmain: a movable label on a commitfeature/loginfeature/login: a movable label on a commitHEADHEAD → the branch you are onREADME.mdunchangedapp.jsunchangedindex.htmlunchangedv2v2v2v1v1v1v2v2v2HEAD → main → a2b8b5d “Document install”

Label

A branch is just a movable label on a commit (main, feature/login…).

YOUR FILES — ONE FILE, THREE PLACESWorking diryour diskStagingnext commitHEADlast commitadd ›commit ›GITUALIZEYOUR REPOSITORY — .git on your laptopa2b8b5dDocument installa2b8b5df5d4f38ac299e9b25e95ebcc998bfb7fa Document install2e039acAdd homepage2e039ac897849007af489a58ee9eec107a21974e Add homepageb272b3aSet up projectb272b3abaca08f2f1c56c0562679f66a61035535 Set up project129c2dbInitial commit129c2db06bfe68f8469dc82e6e05d1c03d1f768c Initial commit960123aCall login on lo…960123a1d58a1488381355be004d5a6ff601640c Call login on load19d2019Add login page19d2019870aaae1bc0c6d1a5aa8cc1f8d76c6473 Add login pagemainmain: a movable label on a commitfeature/loginfeature/login: a movable label on a commitHEADHEAD → the branch you are onREADME.mdunchangedapp.jsunchangedindex.htmlunchangedv2v2v2v1v1v1v2v2v2HEAD → main → a2b8b5d “Document install”

HEAD

Where you are. It sits next to the branch you are on, or on a commit directly when HEAD is detached.

YOUR FILES — ONE FILE, THREE PLACESWorking diryour diskStagingnext commitHEADlast commitadd ›commit ›GITUALIZE☁ ORIGIN — github.com/acme/shop (another repository)YOUR REPOSITORY — .git on your laptop2b4c917Add to cart2b4c91785b581691dd1665ce1839576f03d6ac23 Add to cart2e039acAdd homepage2e039ac897849007af489a58ee9eec107a21974e Add homepageb272b3aSet up projectb272b3abaca08f2f1c56c0562679f66a61035535 Set up project129c2dbInitial commit129c2db06bfe68f8469dc82e6e05d1c03d1f768c Initial commit2e039acAdd homepage2e039ac897849007af489a58ee9eec107a21974e Add homepageb272b3aSet up projectb272b3abaca08f2f1c56c0562679f66a61035535 Set up project129c2dbInitial commit129c2db06bfe68f8469dc82e6e05d1c03d1f768c Initial commitorigin/mainorigin/main: your LOCAL bookmark of where origin's branch was at your last fetch/pushmainmain: a movable label on a commitHEADHEAD → the branch you are onmainmain: as it exists ON originREADME.mdunchangedapp.jsunchangedindex.htmlunchangedv1v1v1v2v2v2v2v2v2HEAD → main → 2b4c917 “Add to cart”

Dashed label

origin/main and friends: your last known copy of the server’s branches, updated by fetch, pull and push.

YOUR FILES — ONE FILE, THREE PLACESWorking diryour diskStagingnext commitHEADlast commitadd ›commit ›GITUALIZEYOUR REPOSITORY — .git on your laptopb272b3aSet up projectb272b3abaca08f2f1c56c0562679f66a61035535 Set up project129c2dbInitial commit129c2db06bfe68f8469dc82e6e05d1c03d1f768c Initial commit2e039acAdd homepage2e039ac897849007af489a58ee9eec107a21974e Add homepage (unreachable — no branch points here; the reflog still remembers it)mainmain: a movable label on a commitHEADHEAD → the branch you are onREADME.mdunchangedapp.jsunchangedindex.htmlunchangedv1v1v1v1v1v1v1v1v1HEAD → main → b272b3a “Set up project”

Faded dashed circle

An unreachable commit — no branch points at it any more, but it still exists (the reflog can bring it back).

YOUR FILES — ONE FILE, THREE PLACESWorking diryour diskStagingnext commitHEADlast commitadd ›commit ›GITUALIZE☁ ORIGIN — github.com/acme/shop (another repository)YOUR REPOSITORY — .git on your laptop2b4c917Add to cart2b4c91785b581691dd1665ce1839576f03d6ac23 Add to cart2e039acAdd homepage2e039ac897849007af489a58ee9eec107a21974e Add homepageb272b3aSet up projectb272b3abaca08f2f1c56c0562679f66a61035535 Set up project129c2dbInitial commit129c2db06bfe68f8469dc82e6e05d1c03d1f768c Initial commit2e039acAdd homepage2e039ac897849007af489a58ee9eec107a21974e Add homepageb272b3aSet up projectb272b3abaca08f2f1c56c0562679f66a61035535 Set up project129c2dbInitial commit129c2db06bfe68f8469dc82e6e05d1c03d1f768c Initial commitorigin/mainorigin/main: your LOCAL bookmark of where origin's branch was at your last fetch/pushmainmain: a movable label on a commitHEADHEAD → the branch you are onmainmain: as it exists ON originREADME.mdunchangedapp.jsunchangedindex.htmlunchangedv1v1v1v2v2v2v2v2v2HEAD → main → 2b4c917 “Add to cart”

ORIGIN region

Shown when a lesson uses a remote: the server’s repository above yours, so push and fetch visibly move commits between them.

3 The terminal

Every lesson is a list of Git commands. A Git simulator built into the site runs them in your browser — before each release, its output is verified line by line against real Git 2.48.

~/shop — bashgit add -p
$ git add -p app.js
diff --git a/app.js b/app.js index 4f29dbf..1cd9aa2 100644 --- a/app.js +++ b/app.js @@ -1,6 +1,6 @@ const cart = [] function add(item) { - cart.push(item) + if (item) cart.push(item) } function remove(item) { const i = cart.indexOf(item) (1/2) Stage this hunk [y,n,q,a,d,j,J,g,/,e,p,?]?

Prompts

Interactive commands (add -p, rebase -i) pause on each question so you can read it before the answer is typed.

~/shop — bashgit commit
$ git commit
✎ .git/COMMIT_EDITMSGsaved ✓ — git continues
Add cart feature
 
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch main
# Changes to be committed:
# modified: app.js
#
# Untracked files:
# login.js
#

Editor view

When Git opens an editor (commit message, rebase todo list, tag message) the stage shows the file being edited.

$try any command… (help)✎ Edit a file
Stuck? Likely next commands
cat index.html
See the conflict: yours is between <<<<<<< and =======, theirs below
code index.html
Resolve it in the editor (keeps both sides, removes the markers)
git add index.html
After resolving: tells Git “index.html is fixed”

Playground

Lessons are watch-only. To type your own commands, open the Playground (link under every visualization): the graph reacts exactly like in the lessons, and hints suggest the most likely next commands when you get stuck.

~/shop — bashgit fetch
# meanwhile… Sam pushes 7f94dc7 “Update README” to origin/main
$ git fetch
remote: Enumerating objects: 5, done. remote: Counting objects: 100% (5/5), done. remote: Compressing objects: 100% (1/1), done. remote: Total 3 (delta 1), reused 0 (delta 0), pack-reused 0 (from 0) Unpacking objects: 100% (3/3), 312 bytes | 312.00 KiB/s, done. From github.com:acme/shop 2e039ac..7f94dc7 main -> origin/main

Teammate lines

A narration line like “a teammate pushes…” means someone else changed the server — the reason a later push or pull behaves the way it does.

4 One message at a time

A step is split into beats. Each beat changes one thing and explains it in a caption at the bottom of the stage; everything else dims.

~/shop — bash① the command is typed
$ echo "<p>Sale</p>" >> index.html
YOUR FILES — ONE FILE, THREE PLACESWorking diryour diskStagingnext commitHEADlast commitadd ›commit ›GITUALIZEYOUR REPOSITORY — .git on your laptop2e039acAdd homepage2e039ac897849007af489a58ee9eec107a21974e Add homepageb272b3aSet up projectb272b3abaca08f2f1c56c0562679f66a61035535 Set up project129c2dbInitial commit129c2db06bfe68f8469dc82e6e05d1c03d1f768c Initial commitmainmain: a movable label on a commitHEADHEAD → the branch you are onREADME.mdunchangedapp.jsstagedindex.htmlmodifiedv1v1v1v2v2v1v3v2v2HEAD → main → 2e039ac “Add homepage”

Cause first

The command is typed before anything moves, and the panels change only when its effect lands.

YOUR FILES — ONE FILE, THREE PLACESWorking diryour diskStagingnext commitHEADlast commitadd ›commit ›GITUALIZE☁ ORIGIN — github.com/acme/shop (another repository)YOUR REPOSITORY — .git on your laptop2e039acAdd homepage2e039ac897849007af489a58ee9eec107a21974e Add homepageb272b3aSet up projectb272b3abaca08f2f1c56c0562679f66a61035535 Set up project129c2dbInitial commit129c2db06bfe68f8469dc82e6e05d1c03d1f768c Initial commit2e039acAdd homepage2e039ac897849007af489a58ee9eec107a21974e Add homepageb272b3aSet up projectb272b3abaca08f2f1c56c0562679f66a61035535 Set up project129c2dbInitial commit129c2db06bfe68f8469dc82e6e05d1c03d1f768c Initial commit2b4c917Add to cart2b4c91785b581691dd1665ce1839576f03d6ac23 Add to cartmainmain: a movable label on a commitorigin/mainorigin/main: your LOCAL bookmark of where origin's branch was at your last fetch/pushHEADHEAD → the branch you are onmainmain: as it exists ON originREADME.mdunchangedapp.jsstagedindex.htmlunchangedv1v1v1v2v2v1v2v2v2HEAD → main → 2e039ac “Add homepage”
A new commit 2b4c917 is born — a snapshot of everything in Staging. main moves onto it (HEAD comes along — it points to main)

Caption

What just happened and why, in one sentence. The panel next to the terminal repeats it with the step’s explanation.

  1. 1Look aroundgit log --oneline
  2. 2You editecho "cart.push(item)" >> app.js
  3. 3New fileecho "export function login() {}" > login.js
  4. 4Ask gitgit status
  5. 5Stagegit add app.js login.js

Chapters

The numbered list under the explanation. Click any step to jump to it.

5 Controls

Play it like a video or step through it.

⏮◀▶▶|1× ▾

⏮ ◀ ▶ ▶|

Restart, previous step, play / pause, next step.

⏮◀▶▶|1× ▾

Timeline

Drag to scrub to any moment of the lesson.

⏮◀▶▶|1× ▾

Speed

0.5× to 2×.

Spaceplay / pause←→previous / next step

Keyboard

Click the stage, then Space = play / pause, ← / → = previous / next step.

6 Command pages, options and scenarios

Where the visualizations live.

--force-with-leaseGit ≥ 1.8.5Recommended
▷ Show Visualization

Command page

The main visualization covers the everyday use of the command. Each option has its own short visualization — open it from the Options list.

RecommendedMainstream, safe choiceWhen neededUseful in specific casesNot recommendedRisky or superseded

Recommendation

Every option carries a badge: Recommended, When needed or Not recommended, with a one-line reason.

git add --editGit ≥ 1.6.4

Open the diff in your editor before staging. You can manually edit which changes to include.

$ git add -e app.js

Why there is no animation

git add -e opens the whole diff as a patch in your editor; you delete the lines you do not want staged and git applies what is left. It is a hand-edited file, not a repository state change the stage can animate — git add -p is the visual equivalent.

How it works

A few options depend on things outside the repository (your editor, file permissions, line endings). They get an explanation card instead of an animation.

1Start the feature
Branch
$ git switch -c feature/login
Login page
$ echo "export function login() {}" > login.js && git add login.js && git commit -m "Add login page"
Wire it up
$ echo "login()" >> app.js && git commit -am "Call login on load"

Scenarios

Real-world walkthroughs played as one continuous story, split into titled sections you can click.

Settings

The gear button in the header holds the settings: language, light or dark site, the visualization theme, a colour-blind mode and the text size.

Ready to learn?

Follow a whole workflow, or pick a command.