βΆ Play it live: https://shaqa3.github.io/git-dojo/
β² A βFork & Mergeβ speedrun, solved live β typed commands, a reacting commit graph, and the timer stopping on success.
An interactive, fully offline trainer for learning Git by doing. Practice real commands in a simulated terminal, watch a live commit graph react, and progress through 15 guided katas β then race the clock in the speedrun sandbox.
There is no AI/LLM and no network access at runtime. The "git" behind the
terminal is a deterministic JavaScript simulator (src/git-engine.js) that is
unit-tested; the whole app ships as a single self-contained HTML file.
Open the built file directly in any browser β no server, no dependencies:
npm run build # writes dist/git-dojo.html
open dist/git-dojo.html # macOS (or just double-click the file)dist/git-dojo.html is standalone: you can email it, host it on any static
server, or open it from disk offline.
- 9 belt katas β first commit, staging, branching, merging, reset, stash, cherry-pick, rebase, and resolving a merge conflict.
- 6 black-belt "Dan" katas β revert, tags, reflog recovery, interactive-rebase squash, remote sync (fetch/pull/push), and a diverged-push resolution.
- Speedrun sandbox β 6 timed challenges with a live timer, command counter,
and personal bests saved to
localStorage. - Interactive rebase modal (pick / reword / squash / fixup / drop / reorder), a diff viewer, tags & remote refs on the graph, and a challenge mode that hides the hints.
Supported commands include init, add, status, commit, branch, checkout, switch, merge, reset, restore, log, stash, cherry-pick, rebase (+ -i), tag, revert, reflog, diff, remote, fetch, push, pull, plus shell helpers (echo >, touch,
cat, ls, rm, clear).
git-dojo/
βββ src/
β βββ git-engine.js # the tested git simulator (source of truth)
β βββ ui.html # UI shell + katas + speedrun; /*__ENGINE__*/ marks the inject point
βββ build.js # inlines the engine into the UI -> dist/git-dojo.html
βββ dist/
β βββ git-dojo.html # built, self-contained app (the deliverable)
βββ test/
βββ engine.test.js # 36 unit tests for core commands
βββ advanced.test.js# 46 unit tests for tags/revert/reflog/diff/rebase-i/remotes
βββ kata-sim.js # drives every kata to completion via its own hints
βββ dom-smoke.js # boots the real bundle under a stub DOM (no throws + speedrun)
Edit src/git-engine.js (logic) or src/ui.html (interface/katas), then:
npm test # build + run engine tests, kata simulation, and the DOM smoke test
npm run buildThe engine is developed test-first: test/engine.test.js and
test/advanced.test.js exercise it directly in Node. kata-sim.js extracts the
real kata definitions from the built HTML and confirms each one is completable by
its suggested commands. dom-smoke.js executes the shipped bundle against a
minimal stub DOM to catch render-time errors and to run the full speedrun
lifecycle. All four must pass before shipping.
Contributions are welcome β bug fixes, new katas, new speedrun challenges, and
new simulated commands. The project is intentionally dependency-free: edit
src/, run npm test (it must stay green), and never hand-edit the generated
dist/git-dojo.html.
See CONTRIBUTING.md for the full guide β dev setup, how to add a command / kata / challenge, the test suite, and the PR workflow. Bug reports and ideas are welcome via issues.
Released under the MIT License.
