An animated, interactive book that teaches Git & GitHub with living diagrams and sound β
from your very first git init to interactive rebase and reflog rescues.
Most people learn Git by memorizing magic words and praying. The commands only click when you can see what they do β a commit sliding from the staging area into history, a branch pointer gliding forward, a merge tying two rails together.
Git Visual Book turns every core Git concept into a short animated scene. Each lesson pairs plain-English reading with a living SVG diagram, copy-ready commands, and one practical tip a working developer would actually give you.
No framework. No build step. No CDN. No internet required. One HTML file you can open by double-clicking β on a laptop or a phone.
Zero to your first push, with confidence.
| # | Lesson | You walk away knowing |
|---|---|---|
| 1 | Git vs GitHub | The tool vs the website β and why they're different things |
| 2 | Install & First Config | user.name, user.email, init.defaultBranch main |
| 3 | Start a Repo | git init vs git clone, and why you never mix them |
| 4 | Add β Commit β Push | Working dir β staging β local repo β GitHub |
| 5 | Status & Log | Reading where you are and how you got there |
| 6 | .gitignore | Keeping secrets and junk out of history forever |
| 7 | Remove Git History | What deleting .git really does |
| 8 | GitHub Authentication | Personal access tokens and SSH keys |
Branching, team workflows, and undoing things safely.
| # | Lesson | You walk away knowing |
|---|---|---|
| 1 | What a Branch Really Is | Branches are movable pointers, not copies |
| 2 | Merging Branches | Fast-forward vs merge commits |
| 3 | When Merges Collide | Conflict markers and the resolve loop |
| 4 | Reading Changes | diff, diff --staged, diff main..feature |
| 5 | Parking Unfinished Work | The stash stack |
| 6 | reset vs revert vs restore | The most-confused trio, untangled |
| 7 | Fixing the Last Commit | --amend and when it becomes dangerous |
| 8 | fetch, pull & Remote Branches | Tracking branches and -u |
| 9 | Fork & Pull Request Workflow | origin vs upstream, the open-source loop |
| 10 | Tags & Releases | Lightweight vs annotated, pushing tags |
History surgery, rescue operations, and power tools.
| # | Lesson | You walk away knowing |
|---|---|---|
| 1 | Rebase vs Merge | Replaying commits and the golden rule |
| 2 | Interactive Rebase | pick / reword / squash / fixup / drop |
| 3 | Cherry-pick | Copying one commit across branches |
| 4 | Reflog Rescues | Why "lost" commits almost never are |
| 5 | Bisect | Binary-searching 1,000 commits in ~10 tests |
| 6 | Worktrees | Two working folders, one repository |
| 7 | One Folder, Different Repos | Multiple remotes from a single clone |
| 8 | Force Push, Done Safely | --force-with-lease and purging secrets |
| 9 | Blame & Pickaxe | git blame, git log -S, reading history |
| 10 | Hooks | Automatic gatekeepers in .git/hooks |
The whole app is one file. Pick whichever you like:
# 1 β just open it
git clone https://github.com/anhafxd/git-visual-book.git
cd git-visual-book
open index.html # macOS
start index.html # Windows
xdg-open index.html # Linux# 2 β or serve it (identical result)
python3 -m http.server 8000
# β http://localhost:8000Or deploy it in one minute with GitHub Pages: repo β Settings β Pages β
deploy from the main branch. Done β index.html is picked up automatically.
Works fully offline. Google Fonts (Space Grotesk + JetBrains Mono) load when online and degrade gracefully to system fonts when not.
Everything lives in a single self-contained index.html:
- Fluid design system β zero fixed pixel sizes in the layout; everything is
clamp(), container queries, and viewport units, so it scales from a phone to a cinema display. - SVG stage toolkit β a tiny hand-rolled animation library (
schedule,moveGroup,drawCommitDot,typeLine, β¦) drives every scene inside one720 Γ 440viewBox. All timers are cancelable, so Replay is always clean. - Web Audio sound engine β pops, whooshes, and success chords synthesized from raw oscillators; no audio files, and one click mutes it.
- Per-level progress β the rail, counter, and completion state track each level independently.
- Accessible by default β keyboard navigation (β β), focus rings, ARIA labels, and full
prefers-reduced-motionsupport.
Found a factual slip, a typo, or a scene that could teach better? PRs and issues are very welcome. A few ground rules that keep the project what it is:
- One file stays one file. No build steps, no dependencies, no CDN scripts.
- Modern commands first β
git switch/git restore, withgit checkoutnoted as the older form. - Scenes use the stage toolkit β
schedule()for all timing (never rawsetTimeout), animation classes on inner groups, everything inside the720 Γ 440viewBox. - Accuracy beats volume. Every claim should be true of current Git.
Released under the MIT License β use it, fork it, teach with it.






