Skip to content

shaqa3/git-dojo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ₯‹ Git Dojo

CI Topics License: MIT

β–Ά Play it live: https://shaqa3.github.io/git-dojo/

Git Dojo β€” a Fork & Merge speedrun: typing git commands while the commit graph builds live

β–² 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.

Quick start

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.

What's inside

  • 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).

Project layout

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)

Development

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 build

The 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.

Contributing

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.

License

Released under the MIT License.

About

πŸ₯‹ Interactive, fully offline Git trainer: 15 guided katas + a speedrun sandbox on a hand-written git simulator. β–Ά Play: https://shaqa3.github.io/git-dojo/ Β· 🎬 Demo GIF: https://raw.githubusercontent.com/shaqa3/git-dojo/main/assets/demo.gif

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors