Every level, in the open
Git
23 worlds · 250 levels · 21 bosses
SOLUTION HIDDENTeachers see answer keys in the classroom.
Thirteen worlds of real git, from your first commit to shipping through pull requests. Branch, merge, fight conflicts, rewind time, craft clean commits, push to remotes, review teammates and keep CI green on a real machine.
Guided levels show the command first. Alone levels give the goal only. Bosses and exams are timed.
Jump to a world
World 1The Time Vault
9 levelsSave points for your files: config, init, status, add, commit, log and .gitignore.
Level 1: Who are you?
Objective: Tell git who you are: set your user.name and user.email with git config --global.
Git signs every save point with a name and an email. git config --global stores them once, for every repository you will ever make.
Commands taught
git-configLevel 2: The first vault
Objective: Turn ~/saga, where Kern writes his saga, into a git repository.
hidden turns a plain folder into a repository. It creates a hidden .git folder where every save point will live.
Commands taught
git-initLevel 3: The stage
Objective: Put chapter1.md and chapter2.md on the stage, but leave scratch.txt off it.
hidden tells you which files are new, changed or ready. git add puts files on the stage (also called the index): the waiting area for the next save point, and only what is on it gets saved.
Commands taught
git-statusgit-addLevel 4: First save point
Objective: Save the staged chapters as the saga's first commit, with a message.
hidden saves everything on the stage as a snapshot, forever. -m gives the message that says what changed.
Commands taught
git-commitLevel 5: The long message
Objective: Commit the staged chapter3.md WITHOUT -m: subject 'Add chapter 3', an empty line, one sentence about the chapter; then save and quit nano.
Without -m, hidden opens your editor (nano here): line 1 = subject, then an empty line, then the body (why). Ctrl-O Enter saves, Ctrl-X quits; in vim it is Esc then :wq Enter; pick yours with hidden.
Commands taught
git-editorLevel 6: Two save points
Objective: Commit the new chapter3.md, then fix the typo 'dargon' in chapter1.md and commit that separately.
Good history has one commit per change, and git log lists them newest first. A file you change after a commit must be git add-ed again before the next one (hidden -am does that for files git already knows).
Commands taught
git-logLevel 7: Ignore the junk
Objective: Make git ignore every *.log file and the build/ folder in ~/saga, and commit your .gitignore.
A .gitignore file lists patterns git should never track: build output, logs, secrets. Commit it so every copy of the repo ignores the same things.
Commands taught
gitignoreLevel 8: Who deleted the ending?
Objective: Someone made a commit called 'Delete the ending': tell Kern who it was (kern <name>).
git log shows the author, date and message of every commit. The vault never forgets who did what.
Level 9: Boss: the chronicle
Objective: Make ~/chronicle a repo where Archivist (set for this repo only) commits ch1, ch2, ch3 one per commit in order, with *.tmp ignored by a committed .gitignore.
Settings without --global belong to one repository only. Everything else you already know.
World 2The Lens
12 levelsSee through time: diff, diff --staged, show, restore, log searches and blame.
Level 10: Spot the difference
Objective: Someone changed one line of settings.conf: tell Kern its OLD value (kern <value>).
hidden shows what changed since the last commit, line by line. A line starting with - was removed, + was added.
Commands taught
git-diffLevel 11: On stage, off stage
Objective: potions.txt has a staged change and an unstaged one: tell Kern which potion the STAGED change adds.
hidden only shows changes that are NOT staged yet. hidden shows what's already on the stage, ready for the next commit.
Commands taught
git-diff-stagedLevel 12: The old password
Objective: The commit 'Add vault door' put a password in door.txt, removed since: tell Kern that password.
git show <commit> prints one commit: its message and everything it changed. Name a commit by its short hash, or count back from HEAD, git's 'you are here' marker (your latest commit): HEAD~1 is the one before it, HEAD~2 two before.
Commands taught
git-showLevel 13: The long scroll
Objective: Open git log (45 commits), search for 'lighthouse', and tell Kern the first 7 characters of that commit's hash (kern <hash>).
Long output (git log, diff, show) opens in the pager less, like on any real machine; short output just prints. Space = next page, b = back, /word Enter = search, n = next match, q = quit (from now on the Lens always pages).
Commands taught
git-pagerLevel 14: Names for commits
Objective: Try each name for a commit in ~/lens: HEAD, HEAD~1, HEAD^, then a range with ..
Name a commit without its hash: HEAD is the commit you are on, HEAD~1 one back, HEAD~2 two back, and HEAD^ its parent (here the same as HEAD~1). A..B means the commits in B that are not in A.
Commands taught
git-revspecsLevel 15: Cat on the keyboard
Objective: Restore spells.txt to its last committed version, but keep Kern's new line in notes.txt.
git restore <file> throws away the uncommitted edits in that file and brings back the committed version. There is no undo for the undo.
Commands taught
git-restoreLevel 16: Four more lenses
Objective: Try each lens once in ~/lens.
A few more lenses before you work alone: hidden (the same as --staged), git restore --staged (take a file off the stage), git log --grep (search commit messages), git log -S (search what commits changed) and git blame (who wrote each line).
Commands taught
git-restore-stagedgit-log-searchgit-blameLevel 17: Not the secrets!
Objective: Take secrets.env off the stage without deleting it, and keep readme.md staged.
git restore --staged <file> takes a file off the stage. The file and your edits stay on disk.
Level 18: Needle in the log
Objective: Among 40 commits, one message mentions the cauldron: tell Kern its hash (7 characters is enough).
git log can search: --grep=word finds commit messages, --author=name finds people. Add --oneline to read fast.
Level 19: Fireball = ice?!
Objective: Someone set 'fireball = ice' in spells.txt: tell Kern who.
git blame <file> shows, for every line, the commit and author that last changed it.
Level 20: Cold case
Objective: Find the commit that added the comment 'HACK' and tell Kern the backdoor password it also put in door.txt.
git log -S word finds the commits that added or removed that word in any file. Pair it with git show to see the whole crime.
Level 21: Boss: the saboteur
Objective: First tell Kern which spell the STAGED change removes from spells.txt, then undo every uncommitted change (backdoor.sh off the stage).
A saboteur left uncommitted changes, some staged, some not. Read the evidence before you destroy it.
World 3The Branching Woods
10 levelsMany paths at once: branch, switch, fast-forward and three-way merges, pruning, and reading the map.
Level 22: A new path
Objective: Create a branch called lantern (you can stay on main).
A branch is just a movable name pointing at a commit. hidden <name> creates one right here; hidden lists them all.
Commands taught
git-branchLevel 23: Walk the torch path
Objective: On a new branch named torch, commit a new file torch.txt; main must not change.
git switch <branch> moves you onto a branch (HEAD, the 'you are here' marker, now points at it), and every new commit moves that branch forward. git switch -c <name> creates it and switches in one go.
Commands taught
git-switchLevel 24: The old spell
Objective: Using only git checkout: create and enter a branch 'lantern', go back to main, then throw away the scribble in map.txt.
Before switch and restore existed, git checkout did both jobs, and most tutorials and older teammates still use it: git checkout -b NAME = switch -c, git checkout NAME = switch, git checkout -- FILE = restore FILE.
Commands taught
git-checkoutLevel 25: Cross the bridge
Objective: Bring the bridge branch's three commits into main.
git merge <branch> brings another branch's commits into the branch you're on. If yours hasn't moved since, git just slides it forward: a fast-forward.
Commands taught
git-mergeLevel 26: Tools for the trail
Objective: In ~/woods/trail, try each tool once.
Three branch tools before you work alone: git merge --no-edit (merge and keep git's message, no editor), hidden (branches already inside yours) and hidden -d / -D (delete a branch name: -d only when it is merged, -D even when it is not).
Commands taught
git-branch-deleteLevel 27: Two roads meet
Objective: Merge the camp branch into main, where both have moved on.
When both branches have new commits, git merge makes a merge commit with two parents. --no-edit keeps git's default message instead of opening the editor.
Level 28: Prune the dead paths
Objective: Delete every branch already merged into main, and keep the unmerged ones.
hidden lists branches whose work is already in yours. hidden -d deletes a merged branch, and refuses an unmerged one.
Level 29: Read the map
Objective: Draw the graph of all branches and tell Kern which trail holds 'Find the hidden spring' (kern <branch>).
hidden draws every branch: * is a commit, | is a line of history, / and \ are where lines split or join. The (name) next to a commit is the branch that points there.
Commands taught
git-log-graphLevel 30: Where is the key?
Objective: One of six paths has the commit 'Found the key': tell Kern which branch (kern <branch>).
hidden --contains <commit> lists the branches that have that commit. hidden draws the whole map.
Level 31: Boss: the crossroads
Objective: Merge scout-north and then scout-east into main, delete those two, keep scout-west, and commit camp.txt on a new branch camp off the result.
Three scouts are back. Use everything the woods taught you.
World 4The Clash
6 levelsWhen two branches change the same lines: conflict markers, resolving, aborting, ours and theirs.
Level 32: Two choruses
Objective: Merge ballad into main and keep BOTH chorus lines in song.txt, without the markers.
When two branches change the same lines, git merge stops and writes both versions into the file between <<<<<<<, ======= and >>>>>>> markers. You edit the file, then git add and hidden to finish.
Commands taught
git-conflictsLevel 33: Pull the brake
Objective: Someone started merging chaos into main and hit conflicts: abort it and leave main as it was.
A conflicted merge is a state you can leave: hidden cancels it and puts everything back as it was before.
Commands taught
git-merge-abortLevel 34: Ours or theirs
Objective: In ~/clash/garage, a merge stopped on two files: keep ours for readme.md, take theirs for engine.ini, then finish the merge.
In a conflict you can take one side of a file whole, no editing. git checkout --ours <file> keeps your branch's version (the one you are on), git checkout --theirs <file> takes the incoming branch's version. Then git add and commit, as always.
Commands taught
git-ours-theirsLevel 35: Ours or theirs
Objective: Merge tuning into main, keeping THEIR config.ini and OUR readme.md.
During a conflict, git checkout --ours <file> keeps your branch's version whole, and --theirs keeps the other branch's. Then git add it as usual.
Level 36: Lamps in a hurry
Objective: Merge lamps into main: lamps.txt keeps every lamp from both sides, colors.ini is theirs, readme.md is ours.
Real merges mix it all: some files need both sides, some need one. hidden lists every file still in conflict.
Level 37: Boss: the three-way clash
Objective: Abort the goblin's half-done merge, then merge feat-red, feat-green and feat-blue so the palette line lists red, green and blue.
Three branches, one line. Clean up first, then merge them one by one.
World 5The Rewind
11 levelsTurn back time safely: stash, amend, reset --soft and --hard, revert, and the reflog that remembers everything.
Level 38: The shelf
Objective: Shelve the unfinished step 3 in recipe.txt, fix the typo 'poshun' and commit it, then bring step 3 back.
hidden puts your uncommitted changes on a shelf and cleans the folder. hidden brings them back.
Commands taught
git-stashLevel 39: Oops, that commit
Objective: Fix the last commit 'Add spel': its message must be 'Add spell' and it must include spell.txt.
hidden --amend replaces the last commit: a fixed message, plus anything you staged since. Use it only on commits nobody else has yet.
Commands taught
git-commit-amendLevel 40: Soft and hard
Objective: In ~/rewind, undo the last commit softly, then throw the leftovers away with --hard.
git reset moves your branch back to an older commit. --soft keeps the undone changes staged, ready to commit again. --hard throws away every uncommitted change in your files: there is no undo for that part.
Commands taught
git-resetLevel 41: Too early
Objective: Undo the last commit 'Add towers (not ready!)' but keep its changes in your files.
hidden removes the last commit but keeps its changes, staged. The work stays, only the save point goes.
Level 42: Two jobs, one commit
Objective: Undo the two-job commit 'Gate and moat, all at once' with a plain (mixed) reset, then commit gate.txt and moat.txt separately.
hidden (no flag = --mixed, the default) removes the last commit and UNstages its changes: they wait in your files, like before git add. Perfect for splitting a commit that did two jobs.
Level 43: Back to stable
Objective: Move the experiment branch back to its commit 'Stable potion', with the files matching.
git reset --hard <commit> moves the branch back AND makes every file match that commit. Uncommitted work is destroyed, so look first.
Level 44: The undo log
Objective: In ~/rewind, revert the last commit, read the reflog, then jump back to before the revert.
Two safety nets. git revert <commit> adds a NEW commit that undoes an old one (safe on shared branches). hidden lists every place HEAD has been, so even a reset commit can be found again: HEAD@{1} means 'where HEAD was one move ago'.
Commands taught
git-revertgit-reflogLevel 45: Undo in public
Objective: Undo the shared commit 'Turn the dragon purple' with git revert, keeping every later commit.
When others already have your history, don't rewrite it. git revert <commit> adds a NEW commit that undoes an old one.
Level 46: Lost treasure
Objective: A git reset --hard lost the commits 'Pirate route' and 'Treasure map': bring both back into main.
hidden lists every place HEAD has been, even commits no branch points to anymore. HEAD@{1} means 'where HEAD was one move ago', and git reset --hard can jump back there (a hash works too).
Level 47: Friday cleanup
Objective: Turn 'WIP 1' and 'WIP 2' into a single commit 'Add the ending', and keep your staged notes.txt edit out of it, but not lost.
Before you share commits, clean them up: reset --soft and --amend can merge commits into one. Stash keeps unrelated work out of the way.
Level 48: Boss: rescue the history
Objective: Bring back the deleted branch legend and the lost commit 'Chapter 9' into main, and undo the shared commit 'Wipe the archive' without rewriting it.
Someone wrecked this repo: a deleted branch, a lost commit and a shared bad commit. The reflog remembers it all.
World 6The Weave
9 levelsRewrite your own history neatly: rebase, cherry-pick, rebase conflicts, squash, and bisect to hunt a bug.
Level 49: Straight thread
Objective: Rebase the loom branch onto the latest main.
git rebase <base> replays your branch's commits on top of base, as if you had started there. History becomes a straight line, no merge commit.
Commands taught
git-rebaseLevel 50: Pick one cherry
Objective: Bring only the commit 'Fix the broken thread' from dev onto main.
git cherry-pick <commit> copies one commit onto the branch you're on, without the rest of its branch.
Commands taught
git-cherry-pickLevel 51: Knotted thread
Objective: Rebase gold onto main and keep both the red thread and the gold thread in weave.txt.
A rebase can stop on a conflict, just like a merge. Fix the file, git add it, then hidden (or --abort to give up).
Commands taught
git-rebase-continueLevel 52: Three into one
Objective: Squash the last 3 commits of tapestry into one commit named 'Weave the tapestry'.
Squashing turns several messy commits into one clean commit. hidden then one hidden does it.
Commands taught
git-squashLevel 53: Off the path
Objective: Visit tag v1 (the blue pattern) with hidden, add a line 'gold' to cloth.txt and commit it, then save that work on a new branch 'blue-idea'.
git switch --detach <commit> (or git checkout <hash>) puts HEAD on a commit instead of a branch: 'detached HEAD'. You can look and even commit there, but those commits belong to no branch until you run git switch -c NAME.
Commands taught
git-detached-headLevel 54: Halving the search
Objective: In ~/weave/loom, a test broke somewhere in the last 4 commits: find the culprit with git bisect.
git bisect finds the commit that broke something by halving the history: start, mark a bad commit and a good one, and git checks out the middle. git bisect run <test> lets a script answer good (exit 0) or bad for every step. hidden brings you back.
Commands taught
git-bisectLevel 55: Bug hunt
Objective: ./check.sh fails on main but passed in the first commit: tell Kern the hash of the first bad commit.
git bisect finds the commit that broke something by binary search: mark one bad and one good commit, then git tests the middle. git bisect run <script> does it all for you.
Level 56: Sixty rows
Objective: Bisect the 60 shared commits to find the one that breaks ./check.sh, then undo it on main with git revert.
Find, then fix: a bisect points at the culprit, a revert undoes it without rewriting shared history.
Level 57: Boss: the master weaver
Objective: Cherry-pick 'Fix the frayed edge' onto main, make banner one commit 'Add the banner' rebased on main (keep both weave.txt changes), fast-forward main.
Before a feature joins main, it gets the hotfixes, a clean single commit, and a straight line.
World 7The Harbor
11 levelsWork with others: clone, push, remotes, fetch and pull, rejected pushes, and hooks that guard the repo.
Level 58: A copy of the atlas
Objective: Clone /srv/git/atlas.git into ~/harbor/atlas.
git clone <url> copies a whole repository, every commit included, and remembers where it came from as a remote (a named link to another copy of the repo) called 'origin'. Here the 'server' is just a folder: /srv/git/atlas.git. hidden lists remotes with URLs.
Commands taught
git-cloneLevel 59: Send it out
Objective: In ~/harbor/atlas, commit a new file port.txt and push it to origin.
hidden sends your new commits to the remote, so others can get them. Commit first: push only sends commits.
Commands taught
git-pushLevel 60: Publish the logbook
Objective: Connect ~/harbor/logbook to the empty /srv/git/logbook.git as origin and push main with -u.
git remote add <name> <url> connects an existing repo to a remote. hidden pushes and makes main track origin/main, so later a plain hidden or pull knows where to go.
Commands taught
git-remoteLevel 61: What's new upstream?
Objective: In ~/harbor/tides-log, set main's upstream, fetch, list what's new upstream, then pull it with --ff-only.
A branch's upstream is the remote branch it tracks (origin/main). hidden downloads new commits, your work untouched. @{u} names the upstream, so HEAD..@{u} = commits there you don't have yet. hidden takes them only if no merge is needed.
Commands taught
git-fetchgit-pullLevel 62: Look before you pull
Objective: Mira pushed a warning to the atlas: tell Kern what to beware of (kern <word>), without changing your main.
hidden downloads the remote's new commits without touching your main: they land in origin/main, your copy's snapshot of the server's main. Then git log origin/main shows what's new.
Level 63: Take it in
Objective: Bring Mira's newly pushed commit into your local main.
hidden is hidden plus merging origin/main into your branch. If you have no new commits, it's a fast-forward.
Level 64: Pick a side, once
Objective: You and Mira both committed: set pull to rebase (globally), then pull so 'Note the full moon' sits on top of Mira's commit.
When you AND the remote both have new commits, plain hidden stops: 'You have divergent branches'. Tell git once how to reconcile: hidden (your commits go on top of theirs: a straight line) or pull.ff only (refuse, and decide by hand).
Level 65: The harbor guard
Objective: Write an executable .git/hooks/pre-commit in atlas that refuses any commit whose staged changes contain SECRET.
Hooks are scripts in .git/hooks that git runs at certain moments. pre-commit runs before every commit, and a non-zero exit cancels the commit. They live on YOUR machine (hidden --no-verify skips them), so teams repeat key checks on the server.
Commands taught
git-hooksLevel 66: Rejected!
Objective: Push your commit 'Place the buoys' to origin, keeping Mira's newer commit there.
If the remote has commits you don't have, hidden is rejected. Get them first with hidden (plain hidden will ask you to choose), which puts your commit on top of theirs, then push again: never force over a teammate.
Level 67: Force, politely
Objective: Rebase your already-pushed branch soundings onto main, then update the remote soundings with --force-with-lease.
After a rebase your branch's commits have new hashes, so a normal push is refused. hidden overwrites the remote branch ONLY if it is still where you last saw it; if a teammate pushed in between, it refuses. Plain --force would erase their work without asking.
Level 68: Boss: harbor master
Objective: Clone fleet.git, add the SECRET hook, push main to a new remote 'mirror' (/srv/git/fleet-mirror.git), commit sails.txt on a new branch sails, push it with -u.
A new fleet joins the harbor. Copy it, guard it, mirror it, and send out its first branch.
World 8The Scribe
11 levelsWrite history people can read: real editors, good messages, staging only what belongs, and tidy files.
Level 69: The other editor
Objective: In ~/scribe/notes, make vim git's editor, abort one commit with :cq, then commit the staged notes.md for real in vim.
vim is on every server, so sooner or later git opens it: press i to type, Esc to stop, then :wq Enter to save and quit. :cq Enter quits with an error, and git aborts the commit.
Commands taught
vim-commitLevel 70: Fifty, then seventy-two
Objective: In ~/scribe/scrolls, commit the staged read.sh fix from your editor: a short imperative subject, a blank line, and a body saying why.
A good message is a subject of 50 characters or fewer, written as an order ('Fix…', not 'Fixed…') with no period, then a blank line, then a body wrapped at 72 that says WHY. Tools like hidden and every forge show only the subject.
Commands taught
commit-messageLevel 71: feat, fix, docs
Objective: In ~/scribe/spells, make three commits, one per changed file: feat for frost.sh, fix for fire.sh, docs for README.md.
Many teams use Conventional Commits: type(optional scope): description, e.g. feat: add frost, fix(fire): correct typo, docs: list spells. Tools read the types to build changelogs and pick the next version number.
Commands taught
conventional-commitsLevel 72: Pick the hunks
Objective: In ~/scribe/ledger, commit only the two typo fixes in ledger.sh (guild, total), not the DEBUG line, using git add -p.
git add -p shows your changes one hunk (block of nearby changed lines) at a time: y stages it, n skips it, q stops. One file can then become a clean commit plus leftovers.
Commands taught
git-add-patchLevel 73: Too close together
Objective: In ~/scribe/market, commit only the ink price fix in prices.sh, not the DEBUG line right below it.
When two changes sit only a line apart, git add -p shows them as ONE hunk. Answer s (split) and git cuts it into smaller hunks you can take one by one.
Level 74: Three ways to remove
Objective: In ~/scribe/shelf, try git rm, git rm --cached, then the folder versions with -r and -q.
git rm <file> deletes a file AND stages the deletion. git rm --cached <file> only stops tracking it: the file stays on your disk. -r does a whole folder, and -q (quiet) skips the line git prints for every file.
Commands taught
git-rmLevel 75: Stop tracking it
Objective: In ~/scribe/archive, hidden, untrack app.log but keep it on disk, ignore *.log, and commit.
git rm FILE deletes the file and stages the deletion. git rm --cached FILE only untracks it: the file stays on disk, and a .gitignore line keeps it out from now on.
Level 76: Moving and sweeping
Objective: In ~/scribe/study, rename a file, follow a renamed file's history, then preview and sweep the untracked mess.
git mv old new renames a file and stages the rename. git log --follow <file> keeps following a file's history across renames. git clean deletes untracked files: -n shows what would go (a dry run), -f really deletes, -d includes folders.
Commands taught
git-mvgit-cleanLevel 77: Same story, new name
Objective: In ~/scribe/grimoire, rename spells.txt to grimoire.txt with git mv, commit it, then show its full history with git log --follow.
git mv OLD NEW renames the file and stages it; git notices the rename by content. git log FILE stops at the rename, git log --follow FILE keeps going back.
Level 78: Sweep the desk
Objective: In ~/scribe/desk, preview with hidden, then delete the untracked files and folders, but keep the ignored debug.log.
git clean deletes untracked files: -n only lists what would go (always first!), -f really deletes, -d includes folders, -x also ignored files. Deleted untracked files are not in git: no undo.
Level 79: Inkpot rush
Objective: In ~/scribe/inkpot, make one fix: commit with a body: ink.sh's fix (not DEBUG), cache.db untracked and ignored; then clean up tmp/.
Everything at once, against the clock: stage only what belongs, untrack what should be ignored, write a message a reviewer can read, sweep the rest.
World 9The Bindery
10 levelsRebind your branch before anyone reads it: reword, reorder, drop, squash and split commits, and guard every message.
Level 80: A better title
Objective: In ~/bindery/atlas, use git rebase -i to reword the commit 'fixd stuff' to 'Fix the margin on page 2'.
hidden opens a todo list of your last 3 commits, oldest first, one 'pick' per line. Change pick to reword (or r), save and quit, and git stops to let you rewrite that commit's message.
Commands taught
git-rebase-interactiveLevel 81: Shuffle and cut
Objective: In ~/bindery/book, use git rebase -i to drop 'Add debug notes' and put 'Add chapter 1' before 'Add chapter 2'.
In the rebase -i todo list, the order of the lines IS the new order of the commits, and a deleted line (or drop) is a deleted commit. In nano: Ctrl-K cuts a line, Ctrl-U pastes it above the cursor.
Level 82: Three into one
Objective: In ~/bindery/map, fold the two 'map:' commits into 'Add the map' with git rebase -i, keeping just the message 'Add the map'.
squash (s) melds a commit into the one above it and lets you edit the combined message; fixup (f) melds it and keeps the message above. Typo fixes to your own unmerged work belong inside the commit they fix.
Level 83: A fix with an address
Objective: In ~/bindery/porch, commit the staged fix as a fixup of 'Add login form', then fold it in.
hidden --fixup <commit> makes a commit titled 'fixup! <that subject>'. git rebase -i --autosquash then moves it under its target, already marked fixup: you only save and quit.
Commands taught
git-commit-fixupLevel 84: Fixups that find home
Objective: In ~/bindery/gate, commit the login.html fix with --fixup for 'Add login form', then fold it in with git rebase -i --autosquash.
hidden --fixup HASH records a commit titled 'fixup! <that subject>'. Later, git rebase -i --autosquash puts it right under its target, already marked fixup: you only save and quit.
Level 85: One commit, two ideas
Objective: In ~/bindery/site, split 'Add header and footer' into two commits, header first, with git rebase -i and edit.
edit (e) stops the rebase right after that commit. Undo it with hidden (the changes stay in your files), commit them in pieces, then hidden.
Level 86: Patches and test runs
Objective: In ~/bindery/press, mail a commit to yourself and apply it back, then make an empty commit and test every commit with --exec.
Some projects take commits by email: git format-patch writes commits as .patch files, git am applies them. hidden --allow-empty commits with no change, and git rebase --exec runs a command after every replayed commit.
Level 87: The gatekeeper
Objective: In ~/bindery/gatekeeper, write an executable .git/hooks/commit-msg that rejects any subject that is not Conventional (feat: …, fix(scope): …).
A commit-msg hook runs after you write the message, with the message file's path as $1; exiting non-zero cancels the commit. Teams use one to enforce Conventional Commits.
Commands taught
commit-msg-hookLevel 88: Before the review
Objective: In ~/bindery/search, turn feature/search into exactly 3 Conventional commits (box, results, tests), one file each, without the debug commit.
Seven commits named wip, debug and fix test are your notes, not your story. Rebuild them into the commits a reviewer wants: any method that keeps the code works.
Level 89: Make it reviewable
Objective: In ~/bindery/export, clean feature/export (fixup 'wip', reword to Conventional), install the team's commit-msg hook, and push with --force-with-lease.
Your feature/export branch is already on origin and about to be reviewed. Fold the wip, fix the message, guard future messages, and publish the rewrite safely.
World 10The Lighthouse
9 levelsMark the commits that ship: lightweight and annotated tags, publishing and fixing them, version names and signed tags.
Level 90: A name for a commit
Objective: In ~/lighthouse/lamp, put the lightweight tag v0.1.0 on the current commit, then list the tags.
A tag is a fixed name for one commit: unlike a branch it never moves. git tag NAME puts a lightweight tag (just a name, nothing else) on HEAD; git tag lists them.
Commands taught
git-tagLevel 91: Carved in stone
Objective: In ~/lighthouse/stone, make the annotated tag v1.0.0 on HEAD with the message 'First light', then look at it with hidden.
git tag -a NAME -m MSG makes an annotated tag: a real object with the tagger, a date and a message (and room for a signature). Releases use annotated tags; lightweight ones are private bookmarks.
Commands taught
git-tag-annotatedLevel 92: Light the signal
Objective: In ~/lighthouse/signal, publish only the tag v1.1.0 to origin. The tag try-me must stay on your machine.
hidden sends branches, not tags. Publish one tag with hidden origin TAG. hidden sends EVERY local tag, scratch ones included, so release managers push tags by name.
Commands taught
git-push-tagsLevel 93: Wrong rock
Objective: In ~/lighthouse/beam, v1.2.0 (already on origin) sits on 'wip: blue glass test'. Put it, annotated, on 'feat: brighter lamp' instead, locally and on origin.
git tag -d NAME deletes a local tag; hidden origin --delete NAME deletes it on the remote. Fixing a tag = delete both, re-tag, push. Only do it before anyone fetched it: once teammates have it, ship a new version instead.
Commands taught
git-tag-deleteLevel 94: The keeper's tools
Objective: In ~/lighthouse/keeper, try each tag tool once.
Tag tools for the nights ahead: hidden names a commit by its nearest tag, git tag -d deletes a tag here, hidden origin --delete removes one from the remote, and git tag -v checks a signed tag's signature.
Commands taught
git-describegit-tag-verifyLevel 95: Where am I?
Objective: In ~/lighthouse/log, save hidden's name for HEAD into version.txt.
hidden names a commit after the nearest annotated tag behind it: v2.0.0-3-g1a2b3c4 = 3 commits after v2.0.0, at commit 1a2b3c4. Builds stamp it into their version string. Lightweight tags only count with --tags.
Level 96: The keeper's seal
Objective: In ~/lighthouse/vault, Mira signs every release (her key is imported). Check the three v3.0.x tags with git tag -v; delete the one that fails.
A signed tag (git tag -s) carries a GPG signature made with the tagger's private key. git tag -v NAME checks it against public keys you trust: 'Good signature' or an error. A name in the Tagger line proves nothing: anyone can type 'Mira'.
Level 97: Release night
Objective: In ~/lighthouse/night, make v1.4.0 annotated on 'chore(release): 1.4.0' here and on origin (now lightweight, wrong commit) and remove tag tmp from origin.
Release managers fix tags fast and in the open: annotated on the release commit, pushed by name, strays removed from the remote.
Level 98: First light
Objective: In ~/lighthouse/tower: annotated v2.0.0 on the release commit, drop the 1.x tag failing git tag -v (both places), push only v2.0.0, describe > version.txt.
Cut 2.0.0 like a release manager: an annotated tag on the release commit, no impostors on origin, only the release tag published, and a build stamped with hidden.
World 11The Beacon
11 levelsShip versions people can trust: release notes from history, the right version number, releases on the forge, hotfixes on two lines, and undoing a bad merge.
Level 99: Between two lights
Objective: In ~/beacon/notes, save the subject of every commit in v1.1.0 but not in v1.0.0 into notes-1.1.0.txt, one per line.
A..B means: commits reachable from B but not from A. git log v1.0.0..v1.1.0 is exactly what changed in 1.1.0. --format=%s prints only the subjects.
Commands taught
git-log-rangeLevel 100: Notes for the sailors
Objective: In ~/beacon/changes, write CHANGES.md: every feat: and fix: subject since v1.1.0 as '- subject' lines, and nothing else.
Conventional Commits make release notes a query: users care about feat: and fix:, not chore: or docs:. Several --grep options are OR'ed, and '^feat' matches the start of the message.
Commands taught
git-changelogLevel 101: The right number
Objective: In ~/beacon/bump, read what changed since v1.4.2 and put the right next version on HEAD as an annotated tag.
Semantic versioning MAJOR.MINOR.PATCH: only fix: since the last release → PATCH +1; any feat: → MINOR +1 (patch back to 0); a breaking change (feat!: or a 'BREAKING CHANGE:' footer) → MAJOR +1 (the rest to 0).
Commands taught
semverLevel 102: Raise the flag
Objective: In ~/beacon/flag (a clone from the team forge), push the tag v2.3.0 and publish it as a release titled 'v2.3.0' with notes.md as its notes.
A release on a forge (GitHub, GitLab, Forgejo) is a pushed tag plus a title and notes, shown on the project page. The forge refuses a release for a tag it does not have. forge release create works like gh release create.
Commands taught
forge-releaseLevel 103: Read the log, pick the number
Objective: In ~/beacon/pick, tag HEAD with the correct next version after v3.2.1 (annotated), then push that tag to origin.
Bumping is mechanical once you read the commits: any breaking change wins (MAJOR), else any feat (MINOR), else fixes only (PATCH). Look at bodies too: 'BREAKING CHANGE:' can hide in a footer.
Level 104: Patch the old light
Objective: In ~/beacon/ship, bring only 'fix: lamp overheats' from main onto release/1.x and tag it v1.6.1 (annotated). The new features stay on main.
Teams keep a release branch (release/1.x) for the version customers run while main moves on. A fix made on main is copied over with git cherry-pick -x (the -x adds '(cherry picked from commit …)'), then tagged as a patch release.
Commands taught
release-branchesLevel 105: Undo a merge, carry a fix
Objective: In ~/beacon/dock, revert the bad merge with -m 1, then carry the hotfix over with cherry-pick -x.
A merge commit has two parents, so git revert needs to know which side to keep: -m 1 keeps the first parent (the branch you merged INTO). git cherry-pick -x copies a commit and notes 'cherry picked from <hash>' in the message.
Commands taught
git-revert-mergeLevel 106: Douse the bad merge
Objective: In ~/beacon/storm, the merge of feature/fog broke main and a docs commit came after it. Undo the merge with a revert, keeping the docs commit and history.
git revert of a merge needs -m 1: 'keep parent 1' (the main line) and undo what the merged branch brought. It adds a new commit, so it is safe on a pushed, shared main, unlike reset.
Level 107: Light it again
Objective: In ~/beacon/reland, feature/fog is fixed now. Land ALL of it on main (its first version was merged, then reverted): main's fog.sh must match feature/fog's.
After reverting a merge, git still counts the branch's old commits as merged: merging it again brings only the NEW commits. To re-land everything, first revert the revert (git revert HASH-OF-THE-REVERT), then merge the fixed branch.
Level 108: Hotfix in five
Objective: In ~/beacon/rush, on release/1.2: brightness=80 in lamp.conf, commit 'fix: restore brightness', annotated v1.2.1, push both; then cherry-pick it to main, push.
Hotfix routine: fix on the release branch, tag the patch, push branch and tag, then bring the fix to main so it can't come back next release.
Level 109: Release day
Objective: In ~/beacon/day: CHANGES.md (feat/fix since v1.9.0), the right tag on HEAD, push + forge release -F CHANGES.md, then 'fix: lamp flicker' on 1.x as v1.9.1.
Ship 2.0.0 end to end: notes from history, the right number, the tag on the forge, the release page, and the hotfix on the old line too.
World 12The Guild
14 levelsWork like a team: branches become pull requests, Mira reviews them, CI checks them, and protected main only takes green, approved work.
Level 110: Ask, don't push
Objective: In lantern, make a branch add-amber that sets color=amber in lantern.conf, push it, and open a pull request for it.
On a team, main is protected: nobody pushes to it directly. You push a branch and open a pull request (PR), a request to merge it that teammates can read, test and discuss; forge is the guild's GitHub, and forge pr create works like gh pr create.
Commands taught
forge-prLevel 111: Mira's notes
Objective: Mira requested changes on your pull request #1: read her comments, fix night.sh, push, and get her approval.
A reviewer can approve or request changes, with comments on exact lines. You answer by fixing the code and pushing to the SAME branch: the pull request updates itself and the reviewer looks again.
Commands taught
forge-reviewLevel 112: A tour of the desk
Objective: Read issue #1, check the CI of your PR #2 that fixes it, read the run's log, then squash-merge the PR.
Try the everyday forge commands once: forge issue view N reads an issue, forge pr checks N shows a PR's CI result, forge run view ID --log a run's full log, forge pr merge N --squash --delete-branch merges as one commit and deletes the branch.
Commands taught
forge-issueforge-ciforge-mergeLevel 113: Green and merged
Objective: Push your branch fix-night, open a PR that fixes issue #1, make its checks green, get Mira's approval, and squash-merge it.
CI runs the repo's checks (.forge/ci.yml) on every push and reports pass or FAIL on the PR: forge pr checks N, and forge run view ID --log shows why. Protected main merges only approved, green PRs; 'Fixes #1' in the body closes issue #1 on merge.
Level 114: Say why
Objective: Open an issue about the bell ringing at night, then open a PR for quiet-hours whose description has a ## heading and closes that issue.
An issue records a problem or wish (forge issue create), and a PR description says what changed, why, and how it was tested, in Markdown: ## for headings, - for lists. A line like 'Closes #1' links the PR to issue #1 and closes it when the PR merges.
Commands taught
markdownLevel 115: The review desk
Objective: Read Mira's PR #1 and request changes, then check out her PR #2 and approve it.
Reviewing other people's work has four moves: forge pr diff N (read the change), forge pr review N --request-changes -b TEXT (ask for a fix, naming file:line), forge pr checkout N (get the PR's branch to run it), forge pr review N --approve (say yes).
Commands taught
forge-pr-diffforge-pr-checkoutLevel 116: Spot the bug
Objective: Read Mira's PR #1 and request changes, naming the file and line of the bug (file:line).
Reviewing is reading: forge pr diff N shows exactly what a PR changes, + lines added, - lines removed. If something is wrong, request changes and point at the place as file:line, so the author finds it at once.
Level 117: Try before you trust
Objective: Check out Mira's PR #1, run its test, and approve it if it passes.
Reading a diff is half a review; the other half is running it. forge pr checkout N fetches the PR's branch into your clone and switches to it, so you can run its tests before you approve.
Level 118: One clean commit
Objective: Fix what Mira asked on your PR #1 by amending its single commit, then update the PR so she approves.
Some teams want one commit per PR: you fold review fixes into it with hidden --amend, which rewrites the commit. The forge still has the old one, so you update the PR with hidden, never plain --force.
Commands taught
forge-update-prLevel 119: Main moved on
Objective: PR #1 conflicts with main: update schedule with the new main, keep both changes in bell.conf, and push.
While your PR waits, main moves; if it touched the same lines, the PR shows CONFLICTS. Bring main into your branch (hidden, then hidden or git merge origin/main), resolve, push: a rebase needs --force-with-lease, a merge a plain push.
Level 120: The merge desk
Objective: Try each tool once in ~/guild/bell.
hidden shows merged PRs too, forge pr edit N -b TEXT rewrites a description, merge --merge keeps a merge commit, --rebase replays commits. hidden drops deleted origin/ branches, hidden lists all, -D force-deletes.
Commands taught
git-prune-branchesforge-merge-methodsLevel 121: Three ways in
Objective: Merge the three approved PRs, each with the method CONTRIBUTING.md asks for.
forge pr merge N --merge adds a merge commit (the branch's history stays visible), --squash turns the whole PR into ONE new commit, --rebase replays each commit on top of main with no merge commit. Teams pick per kind of branch and write it in CONTRIBUTING.md.
Level 122: Sweep the branches
Objective: Delete feat-a and feat-b (both merged) on the forge and locally, prune stale origin/ branches, and keep feat-c.
Merged branches pile up: hidden origin --delete NAME removes one on the forge, hidden -D NAME locally, and hidden forgets origin/ names that are gone from the forge. hidden -d refuses squash-merged branches (main got NEW commits), so check the PR first.
Level 123: Boss: closing time
Objective: Review and squash-merge Mira's PR #2, update and squash-merge your PR #3 so it closes issue #1, then clean up every branch.
Supper's in an hour. Mira's fix waits for your review, your own PR now conflicts with it, and the guild wants the issue closed and the branches gone.
World 13The Council
12 levelsThe council's ledger has rules, owners and impatient teammates: stack PRs, keep them small, review fast and recover when someone pushes over you.
Level 124: Who owns db/?
Objective: Your PR #1 is blocked on a code owner review: find the owner, request their review, and merge it once approved.
A CODEOWNERS file maps paths to the people who must approve changes there: 'db/ @mira' means any PR touching db/ needs Mira's approval when main protects it. The forge asks owners for review automatically; owners added later you request with forge pr edit N --add-reviewer.
Commands taught
forge-codeownersLevel 125: Not ready yet
Objective: Push export, open it as a draft PR, wait for its checks to pass, then mark it ready so Mira reviews and approves it.
A draft PR (forge pr create --draft) is shared early: CI runs on it, but it can't be merged and reviewers wait. When it is done, forge pr ready N asks for review.
Commands taught
forge-draftLevel 126: Tools for stacks
Objective: Try each tool once in ~/council/ledger: receipts builds on fees, which builds on main.
forge pr create --base B opens a PR into B, not main. git rebase --onto NEW OLD BR moves only BR's own commits (after OLD) onto NEW. git restore --source=B FILE takes a file from branch B. git range-diff BASE V1 V2 compares two versions of the same commits.
Commands taught
git-rebase-ontoforge-small-prsforge-stackedgit-range-diffLevel 127: A PR on a PR
Objective: Your PR #1 (api) is in review and ui builds on it: push ui and open a PR that targets api, not main.
When a second change builds on a first one still in review, open it with --base set to the first PR's branch: its diff shows only the new work. This is a stacked PR.
Level 128: The stack, after the squash
Objective: PR #1 was squash-merged: move ui onto main with only its own commit, update PR #2, and point it at main.
After the base PR is squash-merged, its old commits are not on main, so the stacked branch still carries them. hidden replays only the commits between api and ui onto main; then retarget the PR with forge pr edit N --base main.
Level 129: Reading the room
Objective: Read Bo's four comments on your PR #1 and tell kern the number of the one that must be fixed before merging.
Review comments come in kinds: blocking (a bug, must change), nit (style, the author decides), question (answer it), and the occasional rude one. Good reviewers label theirs (nit:, question:) and explain why.
Commands taught
review-etiquetteLevel 130: Three small PRs
Objective: Branch big mixes docs/, db/ and report.sh changes: open three PRs from main, each with exactly one of those parts.
Small PRs get reviewed in minutes, big ones in days. Split a mixed branch: a new branch from main per part, git restore --source=big PATH takes that part's files from the big branch, commit, push, open a PR.
Level 131: What changed since?
Objective: Mira rebased PR #1: compare your saved fees-v1 with origin/fees and tell kern the number of the commit she really changed.
After a rebase, hidden between two versions of a PR also shows everything main gained. git range-diff BASE OLD NEW pairs up the commits of both versions: = means unchanged, ! means that commit changed (its diff follows).
Level 132: Three PRs, five minutes
Objective: Review all three open PRs: request changes on the one with a secret and the one with a red build, approve the good one.
Fast review is still review: diff for leaks (tokens, keys, passwords), checks for red builds, then a clear verdict. A secret in a PR must not merge, and must be rotated, since it already left the author's machine.
Level 133: Moving target
Objective: Land your stacked PRs on main: merge #1, move ui onto main and retarget #2, then get it merged even if main moves under you.
Some teams require PR branches to be up to date with main before merging, so every merge was tested on top of the latest main. When a teammate merges first, you fetch, rebase and push again.
Level 134: Pushed over
Objective: Get your monthly and yearly report commits back onto report, on top of Bo's weekly report, and push it.
Bo force-pushed his version of a shared branch, and you synced to it with reset --hard: your commits seem gone, but hidden still lists where HEAD was. Put your commits back on top of his (git cherry-pick), then push: nobody's work is lost.
Level 135: Boss: the fees motion
Objective: Add db/002-fees.sql through the full loop: issue, draft PR, green CI, ready, Mira's approval as owner of db/, squash-merge, cleanup.
The council wants fees in the ledger. Issue, branch, draft, CI, owner review, merge, cleanup: the whole loop, no hints.
World 14The Forge Line
9 levelsEvery push goes down the line: CI runs the tests on a clean machine, and only green work reaches main.
Level 136: Down the line
Objective: Push your branch tune, find the run it started, and tell Kern the name of the step that failed (kern NAME).
A pipeline is the list of jobs CI runs on every push, each job a list of steps; the first failing step stops its job and turns the check red. hidden shows the runs, forge run view N --log the whole story.
Commands taught
ci-pipelineLevel 137: Red to green
Objective: Your branch cooldown is red in CI: read the log, fix cool.sh (not the test), push, and get a green run.
A red check is a question with an answer in the log: read the failing line, reproduce it on your machine, fix the code, push to the same branch, and CI runs again. Never 'fix' a test by weakening it.
Level 138: Works on my machine
Objective: tests/ember.sh passes here but fails in CI on branch ember: find what CI is missing, commit it, and push until green.
CI starts from a clean checkout of exactly what you pushed: a file that is only on your disk does not exist there. Green locally, red in CI usually means something was never committed.
Commands taught
ci-clean-checkoutLevel 139: YAML, one piece at a time
Objective: In ~/forgeline/yard, look at the repo's settings, then build a pipeline file one YAML piece at a time.
Pipelines are YAML: plain 'key: value' lines. A line 2 spaces deeper sits INSIDE the line above, and a line starting with '- ' is one list item. hidden shows a repo's settings, like the checks main requires.
Commands taught
yaml-basicsci-lintforge-protectLevel 140: The gate holds
Objective: Merge your pull request #1 into main: find out what main requires, and get it there honestly.
Branch protection can require status checks: a pull request whose required check is red, pending or missing cannot merge. hidden lists main's rules, like a repo's branch protection settings page.
Level 141: Build the line
Objective: On a new branch add-ci, write .forge/ci.yml with a lint job and a test job, push it green, then protect main to require both.
A pipeline is a file in the repo: .forge/ci.yml lists jobs, each with run: (one command) or steps:. Lint it before you push (ci-lint), and once it is green, make main require it.
Level 142: Check before you send
Objective: Add a pre-push hook that runs hidden, watch it stop your broken branch spark, then fix spark.sh and push it green.
A pre-push hook runs on your machine before hidden sends anything: exit non-zero and the push stops. It is fast but skippable (hidden --no-verify), so teams use both: the hook for speed, CI as the rule.
Commands taught
git-pre-pushLevel 143: Clean benches
Objective: On branch bundle the test job can't find dist/bellows.conf: make the pipeline green, keeping both jobs and keeping dist/ out of git.
Every job starts on a clean bench (a fresh checkout), so files one job builds are gone in the next. Build what a job needs inside that job, or pass it on as an artifact; build outputs never go into git.
Commands taught
ci-artifactsLevel 144: Boss: the kiln line
Objective: Add a test job to the pipeline, land branch heat on main through a pull request with green checks, and add a pre-push hook.
Protected main requires green lint and test checks, and the test job doesn't exist yet. Build the line, land your branch through it, and guard your own pushes.
World 15The Foundry
9 levelsReal pipeline files: GitHub Actions and GitLab CI, matrix builds, secrets that never leak, flaky tests and bisect run.
Level 145: Reading the blueprint
Objective: Read .github/workflows/release.yml and tell Kern which job never runs for a pull request (kern JOBNAME).
A GitHub Actions workflow is a YAML file in .github/workflows/: on: says when it runs, jobs: what runs, runs-on: on which machine, steps: uses an action or runs a command. needs: orders jobs, and if: can skip one.
Commands taught
gha-workflowLevel 146: Cast from the mould
Objective: On a new branch add-actions, create .github/workflows/ci.yml from templates/ci.yml with its blanks filled, lint it, and push it green.
Workflows usually start from a template: copy it to .github/workflows/, fill the blanks, lint it. uses: actions/checkout@v4 fetches the code (pin a version after @), run: is a shell command.
Level 147: The other furnace
Objective: The client mirrors to GitLab: on a branch add-gitlab, write .gitlab-ci.yml with stages lint then test (jobs lint and test), lint it, and push it green.
GitLab CI reads one file, .gitlab-ci.yml: stages: lists the stages in order, and every other top-level key is a job with a stage: and a script: list. Jobs of a stage run together; the next stage starts when they pass.
Commands taught
gitlab-ciLevel 148: Pieces of a workflow
Objective: In ~/foundry/pattern, build a workflow piece by piece, then write a matrix piece and an env piece.
A GitHub Actions workflow is YAML with a few fixed keys: name:, on: (when it runs), jobs:, runs-on: (which machine), steps: with uses: (a ready-made action) or run: (a command). strategy: matrix: and env: come on top.
Commands taught
gha-piecesLevel 149: Many moulds, one pattern
Objective: On branch matrix, replace the three copy-pasted jobs in .github/workflows/ci.yml with one job test that uses a matrix over size, and push it green.
A matrix runs the same job once per value: strategy: matrix: size: [small, large] makes test-small and test-large, and ${{ matrix.size }} is the value inside each run. One job to maintain instead of copies.
Commands taught
ci-matrixLevel 150: Keys stay in the vault
Objective: The forge refuses your branch deploy because it contains a key: use the repository secret AWS_ACCESS_KEY_ID instead, rewrite the commit, and push it green.
Never write a credential into a repo: store it as a repository secret and read it with ${{ secrets.NAME }} through env:, and never echo it. A key that reached any commit must be removed from the history (and rotated).
Commands taught
ci-secretsLevel 151: The flickering forge
Objective: CI fails about 2 runs out of 3: find the flaky test, fix the test (not queue.sh), and push the fix on branch steady.
A flaky test passes and fails on the same code: random data, timing, order. Find it by running it many times, then make it test what the code guarantees; retrying until green only hides it.
Commands taught
ci-flakyLevel 152: Forty commits of silence
Objective: main is red and v1.0 was green: find the first bad commit with git bisect run, tell Kern its hash, then hidden.
When main turns red and nobody knows why, give git bisect run the exact command CI runs: it tests commits for you (exit 0 = good, non-zero = bad) and names the first bad one.
Commands taught
ci-bisectLevel 153: Boss: light the foundry
Objective: Turn Mira's draft into a working CI on branch add-ci, land it through a pull request with green checks, and make main require those checks.
Mira left a broken draft workflow and the anvil has no real CI. Build the whole line, GitHub and GitLab, with a secret and a matrix, and make main require it.
World 16The Commons
11 levelskernlib belongs to everyone and to Mira: you can't push to it. Fork it, keep your fork in sync, and get a change merged the open-source way.
Level 154: Not yours to push
Objective: Fork mira/kernlib and clone your fork (guest/kernlib) into ~/commons.
A fork is a server-side copy of someone else's repository that YOU own: you can push to it, and open pull requests from it back to the original. forge repo fork OWNER/NAME makes it; forge repo clone YOU/NAME clones your fork.
Commands taught
forge-forkLevel 155: Two remotes
Objective: This clone was made with plain git clone: add Mira's repo as upstream and fetch it.
A clone of your fork only knows origin (your fork). By convention the original project is the second remote, upstream: git remote add upstream URL, then hidden gives you upstream/main.
Commands taught
git-upstream-remoteLevel 156: The fork falls behind
Objective: Mira added two commits upstream. Bring your local main AND your fork's main up to date.
A fork does not follow the original by itself: when upstream gains commits, your fork's main stays old. Sync = hidden, hidden (or rebase) on main, then hidden.
Commands taught
git-upstream-remoteLevel 157: Read the house rules
Objective: Fix the 'Helo' typo in lib/greet.sh the way CONTRIBUTING.md asks, and open a PR to mira/kernlib.
CONTRIBUTING.md holds the house rules: branch names, tests, changelog, sign-off. hidden -s adds 'Signed-off-by: You' (the DCO, not a cryptographic signature). Inside a fork's clone, forge pr create opens the PR against upstream from YOUR fork's branch.
Commands taught
contributing-mdLevel 158: The maintainer asks for more
Objective: Mira requested changes on PR #1. Do what she asks, keeping the house rules, and get her approval.
A maintainer can request changes on a PR from a fork just like on any PR. You fix it on the same branch in your fork: new commits pushed to origin show up in the PR at once.
Commands taught
forge-update-prLevel 159: Someone else pushed to my branch
Objective: Mira pushed a test onto your PR branch. Your changelog commit isn't pushed yet. Get both onto the PR.
'Allow edits by maintainers' (GitHub) lets the upstream maintainers push to your fork's PR branch, to add a test or fix a nit themselves. Then your branch on the fork has a commit you don't have: integrate it (hidden) before you push, never force over it.
Commands taught
maintainer-editsLevel 160: The triangle
Objective: Set up main so hidden reads from upstream and hidden writes to your fork.
Triangular workflow: you pull from one remote (upstream) and push to another (origin, your fork). hidden (on main) makes hidden read upstream; hidden (or branch.main.pushRemote) makes hidden go to your fork.
Commands taught
git-triangularLevel 161: Patches by mail
Objective: Apply Ada's patch from ~/inbox to main with git am, then write your docs branch's commit as a patch into ~/outbox.
Before forges, and still for Linux and git itself, contributions travel as email patches. git format-patch turns commits into .patch files (author, message, diff); git am applies them as commits and keeps the sender as author (git apply only changes files).
Commands taught
git-format-patchgit-amLevel 162: Upstream won't sit still
Objective: Upstream moved under your PR #1, and one change conflicts. Put the PR on the newest upstream main (it may move again), one signed-off commit, greeting fixed.
While your PR is open, upstream keeps moving. If its new commits touch your lines, rebase your branch onto upstream/main, resolve, and update the PR with hidden. If it moves again, do it again.
Commands taught
git-upstream-remoteLevel 163: Just the fix, please
Objective: Your fork's main has a team tweak. Upstream has a security fix between two features. Get ONLY the fix onto your fork's main.
A long-lived fork often carries its own changes and can't take all of upstream at once. git cherry-pick -x SHA copies one upstream commit onto your branch and notes '(cherry picked from commit …)' so everyone knows where it came from.
Commands taught
git-cherry-pickLevel 164: Boss: your first open-source merge
Objective: Get the Helo typo fix merged into mira/kernlib from your own fork, following CONTRIBUTING.md, then sync your fork's main.
The whole contribution: fork, clone, upstream, house rules, PR from the fork, review, a moving upstream on a protected main, merge, and a synced fork. No hints.
World 17Keys & Trust
12 levelsThe keyring holds the guild's doors: forge your own ssh key, prove who you are without a password, and learn when NOT to trust a server.
Level 165: Forge a key
Objective: Make an ed25519 key pair at ~/.ssh/id_ed25519 with the comment guest@pathtoroot (no passphrase in this VM), then look at both halves.
ssh logs you in with a key PAIR: a private key that never leaves your machine (~/.ssh/id_ed25519) and a public one you hand out (.pub). ssh-keygen -t ed25519 makes it (-C label, -f file). Real keys get a passphrase; this VM uses -N "" so nothing is typed.
Commands taught
ssh-keygenssh-key-pairLevel 166: Show the door your key
Objective: Register your public key on the forge, list your keys, and knock with hidden.
A server lets your key in once it knows the public half. On the forge that's forge ssh-key add FILE.pub (on GitHub: Settings → SSH and GPG keys, or gh ssh-key add). hidden then knocks without asking for a shell: the forge answers with your login name.
Commands taught
forge-ssh-keyLevel 167: Switch to ssh
Objective: This clone came over https and can't push here. Point origin at the ssh URL forge@forge:team/keyring.git and push your commit.
A remote URL picks the door. https://forge/team/keyring.git wants a password or token; forge@forge:team/keyring.git (or ssh://forge@forge/team/keyring.git) uses your key. git remote set-url origin URL switches; branches and tracking stay.
Commands taught
ssh-remote-urlLevel 168: A name for the door
Objective: Your forge key is ~/.ssh/work_ed25519, not the default name. Add a Host vault alias for it, point origin at vault:team/keyring.git and push.
~/.ssh/config names hosts. A block "Host vault" with indented HostName forge, User forge, IdentityFile ~/.ssh/work_ed25519 makes ssh vault, and the URL vault:team/keyring.git, mean: forge, as forge, with that key. First value found wins.
Commands taught
ssh-configLevel 169: The key keeper
Objective: Forge key ~/.ssh/forge_ed25519, no config: start an agent (hidden), load the key with ssh-add, check with hidden, then push.
ssh-agent holds unlocked keys in memory and ssh asks it first. hidden starts one for this shell, ssh-add FILE loads a key (passphrase asked once), hidden lists them. That is why passphrases are bearable.
Commands taught
ssh-agentLevel 170: Whose door is this?
Objective: Try each tool once from ~/keyring.
Servers have keys too. ssh-keyscan HOST asks a server for its public host key (-t ed25519 = only that type). ssh-keygen -l prints a key's fingerprint, the short code admins publish; -f - reads the key from a pipe. ssh-keygen -R HOST removes that host's line from known_hosts.
Commands taught
ssh-known-hostsLevel 171: A stranger at the door
Objective: Pushing fails: the forge's host key changed. Read ~/keyring/NOTICE.md, compare the fingerprint, remove the stale entry from ~/.ssh/known_hosts and push.
ssh remembers each server's key in ~/.ssh/known_hosts. If it changes, ssh refuses: rebuilt server, or someone in the middle? StrictHostKeyChecking: ask, accept-new, no (never). Compare with a fingerprint published somewhere you trust, then ssh-keygen -R HOST.
Level 172: Permission denied (publickey)
Objective: hidden is denied. Find out why with hidden, fix it, and push.
"Permission denied (publickey)": no key ssh offered was accepted. hidden shows the config read and every key Offered or skipped. Usual causes: key not on the forge, config points elsewhere, agent holds another key, private key readable by others.
Commands taught
ssh-debugLevel 173: Two keys, one forge
Objective: id_ed25519 logs in as wanderer (no access to team/). Add a Host work alias that only uses ~/.ssh/work_ed25519, point origin at work:team/keyring.git, push.
A forge knows you by the first key it accepts. With a personal and a work account, ssh may offer the wrong key first (agent or default files). A Host alias with IdentityFile plus IdentitiesOnly yes makes ssh offer ONLY that key.
Commands taught
ssh-identities-onlyLevel 174: New laptop, release in five
Objective: From nothing: make a key, register it, point origin at the ssh URL and push.
A fresh machine has no key, and the repo was cloned over https. Everything from this world, in order, against the clock.
Level 175: Locked out
Objective: Pushing fails, twice over. Make it work: the admins' NOTICE.md is in ~/keyring.
Two faults at once: read each error, fix one, try again. ssh stops at the first wall, so the second one only shows after the first is gone.
Level 176: Boss: the release key
Objective: Make ~/.ssh/release_ed25519, register it, add a Host release alias that offers only it, push main through it.
The guild wants releases pushed with their own key, through their own alias, to a forge whose host key just changed. No hints.
World 18Seals
11 levelsAnyone can type any name into git config. A seal can't be faked: sign your commits and releases, and check the seals of others.
Level 177: A seal of your own
Objective: Make a gpg signing key for Guest <guest@pathtoroot.local> (batch, no passphrase here) and list it.
user.name proves nothing: anyone can commit as "Mira". A signature does. gpg --quick-gen-key "Name <email>" ed25519 sign never makes a signing key; real keys get a passphrase, this VM uses --batch --passphrase ''. hidden shows it.
Commands taught
gpg-keyLevel 178: Seal a commit
Objective: Tell git which key to sign with, commit CHARTER.md signed, and verify it.
hidden -S signs the commit with the key in user.signingkey (a gpg key id or fingerprint). git verify-commit REV checks it, git log --show-signature shows 'Good signature from …' for each commit.
Commands taught
git-commit-signgit-verifyLevel 179: Seal a release
Objective: Make a signed tag v1.0 on main, verify it, and push it to the forge.
Releases are tags, and a signed tag (git tag -s NAME -m MSG) says 'I vouch for this exact commit'. git verify-tag checks it. Tags aren't pushed by hidden: send them with hidden origin NAME.
Commands taught
git-tag-signLevel 180: Seal with your ssh key
Objective: Switch signing to your ssh key, make signing the default, and commit CHARTER.md.
Since git 2.34 the ssh key you already have can sign: gpg.format ssh, user.signingkey ~/.ssh/id_ed25519.pub. commit.gpgsign true signs every commit without -S (tag.gpgSign the same for tags). GitHub and GitLab accept ssh signing keys too.
Commands taught
git-ssh-signingLevel 181: Whose seal is this?
Objective: hidden fails. Create ~/.ssh/allowed_signers with your email and public key, point git at it, and show the signature.
gpg has a keyring; ssh signing has an allowed signers file instead: one line per person, 'email key-type key'. gpg.ssh.allowedSignersFile points git at it; without it git verify-commit can't check ssh signatures at all.
Commands taught
git-allowed-signersLevel 182: The forged rule
Objective: Someone slipped a rule into the charter in Mira's name. Mira signs everything. Find the commit and tell kern its hash (kern HASH).
%G? in git log --format prints each commit's signature status: G good, N none, B bad, U good but untrusted, E can't be checked. A commit can claim any author; only the seal says who really made it.
Commands taught
git-log-signaturesLevel 183: Two faces
Objective: Repos in ~/work must commit as guest@guild.example, signed with ~/.ssh/work_ed25519.pub. Set it up with includeIf, then fix the last commit.
Work email at work, yours at home. In ~/.gitconfig, [includeIf "gitdir:~/work/"] path = ~/.gitconfig-work loads that file only for repos under ~/work/: right email and signing key, no thinking. hidden shows which wins.
Commands taught
git-includeifLevel 184: Seal them all
Objective: Sign the three commits of rules (only the signatures may change) and push the branch.
Signing came too late for three commits. hidden replays and signs each one (hidden does too when commit.gpgsign is on). Same content, new commits: only for branches nobody built on.
Commands taught
git-resignLevel 185: Release night, unsealed
Objective: Sign the last commit on main, make an ssh-signed tag v2.0 on it, push main and the tag.
Signing was switched off and the release commit went out bare. Seal it, tag it, ship both, before the release train leaves.
Level 186: Two candidates
Objective: origin has two 'Release candidate' commits by 'Mira' (release-a, release-b). Only one is really hers. Tag it v3.0 (signed) and push the tag.
Before you vouch for a commit with your own signed tag, check the seal of whoever made it: git verify-commit on each candidate, against your allowed signers.
Level 187: Boss: the guild seal
Objective: includeIf for ~/work (guild email + work key), re-sign the release branch with that identity, push it with a signed tag v1.0.
Your release branch in ~/work was committed with your personal face. Fix the identity for all of ~/work, re-seal the branch as the guild, and ship a signed release. No hints.
World 19Under the Hood
11 levelsOpen the engine: blobs, trees, commits and tags in .git/objects, branches that are just files, and a commit built by hand.
Level 188: Four kinds of things
Objective: ~/hood/mystery.txt holds one object's hash from ~/hood/engine. Find its type with git cat-file -t and tell Kern: kern blob, kern tree, kern commit or kern tag.
Everything git stores is an object named by its hash: a blob (a file's content), a tree (a folder: names → blobs and trees), a commit (a tree + parents + author + message) or a tag (an annotated tag). git cat-file -t HASH says which; git cat-file -p HASH prints it.
Commands taught
git-cat-fileLevel 189: Content in, hash out
Objective: In ~/hood/vault, store spell.txt as a blob in the object database with git hash-object -w (don't stage or commit it).
git hash-object FILE computes the hash git would give that content; with -w it also writes the blob into .git/objects. The name comes from the content alone, so the same bytes always get the same hash, in any repo, on any machine.
Commands taught
git-hash-objectLevel 190: Read the map
Objective: In ~/hood/archive, docs/key.txt changed after the tag v1. Tell Kern the blob hash it had AT v1 (kern <at least 7 characters>).
git rev-parse turns any name into a hash: HEAD~2, v1, main^{tree}, and v1:docs/key.txt (the blob of that path at v1). git ls-tree -r COMMIT lists a commit's tree: mode, type, hash and path of every file.
Commands taught
git-ls-treegit-rev-parseLevel 191: A branch is 41 bytes
Objective: In ~/hood/lamp, create the branch hotfix at 'Fix the lamp' by writing .git/refs/heads/hotfix yourself (no hidden).
Look in .git: HEAD, config, objects/ (the database), refs/heads/ (branches), refs/tags/, logs/ (reflogs). A branch is a plain file in refs/heads/ holding one commit hash and a newline: 41 bytes. Creating a branch = writing that file.
Commands taught
git-refsLevel 192: The plumbing drawer
Objective: Try each plumbing command once in ~/hood/workbench.
Small plumbing commands sit under branch, add and commit: symbolic-ref reads or sets HEAD's branch, update-ref writes a ref (-d deletes it), ls-files --stage lists the index, update-index --add stages a file, write-tree saves the index, commit-tree makes a commit.
Commands taught
git-symbolic-refgit-indexgit-plumbing-commitLevel 193: HEAD points at a name
Objective: Clones of ~/hood/server.git come out empty: its HEAD names refs/heads/master, which does not exist. Point its HEAD at main.
HEAD is usually a symbolic ref: the file .git/HEAD says 'ref: refs/heads/main', a pointer to a branch name, not to a commit. hidden reads it, hidden refs/heads/NAME sets it. In a bare server repo, HEAD picks the branch a fresh clone checks out.
Level 194: Two answers, one winner
Objective: In ~/hood/ledger, release shows 'Broken build' though .git/packed-refs says 'Release 1.2'. Point release at 'Release 1.2' (it's main's tip).
To save files, git can pack refs into one file, .git/packed-refs (git pack-refs, gc). A loose file in refs/heads/ always wins over packed-refs. git update-ref <ref> <new-hash> moves any ref safely, wherever it lives, and logs it.
Level 195: The index is a list
Objective: In ~/hood/stage, stage motd.txt with the line 'Welcome aboard' WITHOUT creating the file (hash-object -w --stdin, then update-index). No commit.
The index (.git/index) is the next commit's file list: mode, blob hash, stage number, path. hidden shows it. git update-index --add --cacheinfo 100644,HASH,PATH adds an entry for a blob that is already in the database, even if no such file exists in your folder.
Level 196: Commit, by hand
Objective: In ~/hood/handmade, recipe.txt is staged. Commit it on main as 'Add the recipe by hand' without hidden: write-tree, commit-tree, update-ref.
hidden is three plumbing commands: hidden saves the index as a tree and prints its hash; hidden-tree <tree> -p <parent> -m <msg> makes a commit object and prints its hash; git update-ref refs/heads/main COMMIT moves the branch.
Level 197: Zero bytes
Objective: In ~/hood/tower, main's ref file is 0 bytes. Rebuild it so main points at 'Top floor' again, with a clean hidden.
A crashed script left .git/refs/heads/main empty: git now calls main a broken ref. The commits are all still in .git/objects. .git/logs/refs/heads/main (main's reflog) has one line per move: OLD NEW who when message. The NEW hash on the last line is main's latest value.
Level 198: The night press
Objective: In ~/hood/press, fix HEAD, stage headline.txt with update-index, commit it on main as 'Print the headline', and tag it with the annotated tag edition-1.
The press's repo is half-broken: HEAD has a typo, and the headline must go out as a proper commit with an annotated tag. Use the plumbing: you know what every command writes now.
World 20The Salvage Yard
11 levelsDead repos come here. Read every reflog, dig dangling commits out with fsck, pack the junk, heal corrupt objects, and float a wreck again.
Level 199: Every branch remembers
Objective: In ~/salvage/kiln, someone ran hidden -f feature main and feature lost its two glaze commits. Put feature back where it was, using its reflog.
HEAD has a reflog, and so does every branch: hidden lists where feature has been. feature@{1} means 'where feature was one move ago', feature@{3} three moves ago. Moving a branch you're not on (hidden -f) only shows in ITS reflog.
Commands taught
git-reflog-datesLevel 200: As it was yesterday
Objective: In ~/salvage/diary, today's commits on main are a mess. Reset main to where it was yesterday (main@{yesterday}), working tree included.
Reflog entries have times, so a ref can be named by date: main@{yesterday}, main@{2.hours.ago}, main@{2026-11-16}. That means 'where main was at that moment', from this repo's reflog. hidden shows the times.
Level 201: Dangling
Objective: In ~/salvage/kitchen, the 'secret spice' stash was dropped by mistake. Find it with hidden and get its change back into recipe.txt.
An object no ref or reflog points to is dangling. A dropped stash is a dangling commit. hidden lists them ('dangling commit <hash>') and copies them to .git/lost-found/. They stay until git gc prunes them (after 2 weeks by default).
Commands taught
git-fsckLevel 202: Pack the attic
Objective: In ~/salvage/attic, check the loose objects with hidden, then pack everything with git gc so no loose objects remain.
New objects are 'loose': one zlib file each in .git/objects/xx/. hidden counts them (count, size) and the packs (packs, size-pack). git gc packs them into one packfile (delta-compressed), packs refs, expires old reflog entries and prunes old unreachable objects.
Commands taught
git-gcLevel 203: The repair kit
Objective: Try each tool once in ~/salvage/yard.
Four tools for a sick repository. hidden checks every object, packed ones too. hidden lets git tidy the repo in the background. git hash-object -w --stdin stores what you pipe in as a blob. git -C DIR runs git in another folder without cd.
Commands taught
git-maintenancegit-object-repairLevel 204: What's so heavy?
Objective: ~/salvage/hoard is huge though its files are tiny. Find the biggest object in its pack and tell Kern its hash (kern <at least 7 characters>).
A pack is .git/objects/pack/pack-X.pack plus pack-X.idx. git verify-pack -v X.idx lists every object: hash, type, size, packed size… Sorting by size (column 3) finds the giants, even files deleted long ago that history still carries.
Commands taught
git-verify-packLevel 205: A bad minute
Objective: In ~/salvage/dock, feature/map was deleted and main was reset --hard 2 commits back. Bring back both: main at 'Add the lights', feature/map at 'Mark the reef'.
hidden -D deletes a branch AND its reflog, but HEAD's reflog still lists every commit you had checked out there. git reset --hard moved main; HEAD@{1} is where it was before.
Level 206: One pack to hold them
Objective: ~/salvage/silo has several packs and loose objects. Repack it into exactly one pack with no loose objects, then register it for git maintenance.
Every fetch or gc --auto can add a pack, and many packs slow lookups. hidden rewrites everything into ONE pack (-a) and deletes old packs and loose copies (-d). hidden opts the repo into background gc and repacks.
Level 207: Bit rot
Objective: In ~/salvage/mill, hidden reports a corrupt object. Heal it from ~/salvage/mill-backup so hidden is clean again.
A disk error left a loose object unreadable; hidden names it. git never overwrites an existing object, so remove the bad file first, then write the content again from a good copy: git -C BACKUP cat-file blob HASH | git hash-object -w --stdin.
Level 208: Before the sweep
Objective: gc --prune=now runs at closing time. In ~/salvage/office, find the lost 'Signed contract' among the dangling commits and put the branch contract on it.
With no reflog entry left, a lost commit is reachable only through hidden: hidden --unreachable --no-reflogs (or --lost-found) lists every unreachable commit. A branch on it makes it safe from hidden.
Level 209: Raise the wreck
Objective: In ~/salvage/flagship: restore main from its reflog file, heal the corrupt object from ../flagship-backup, recover feature/radar, then git gc it clean.
The flagship's repo hit every rock at once: main's ref file is empty, an object is corrupt, a branch was deleted. Repair the refs, heal the database, recover the branch, then pack it clean.
World 21The Giants
12 levelsSome repos are too big to carry, so take only the history, files and folders you need and cut the dead weight out.
Level 210: Only the top floor
Objective: Clone file:///srv/git/atlas.git into ~/giants/atlas with only the newest commit (--depth 1).
git clone --depth 1 URL downloads only the newest commit (a 'shallow' clone): great for CI, but log, blame and bisect see one commit. Use a URL (file:///srv/git/atlas.git here), since a plain local path ignores --depth.
Commands taught
git-clone-shallowLevel 211: I need the history after all
Objective: ~/giants/atlas is shallow: fetch the rest of its history so git log shows all 30 commits.
A shallow clone can grow: hidden --deepen=10 adds 10 more commits, hidden fetches everything that's left and turns it into a normal clone. Needed when you must run git log, blame or bisect.
Level 212: Every commit, no luggage
Objective: Make a partial clone of file:///srv/git/atlas.git in ~/giants/atlas-lite: all history, no old file contents (--filter=blob:none).
git clone --filter=blob:none URL brings every commit and folder listing (tree) but no file contents (blobs) beyond the checkout; old versions arrive on demand. History stays complete, and the server must allow it (GitHub and GitLab do).
Commands taught
git-clone-partialLevel 213: Only my floors
Objective: In the monorepo ~/giants/mono, keep only services/api and docs checked out (cone mode).
git sparse-checkout set DIR… keeps the repo whole but puts only those folders (plus top-level files) on disk. Cone mode (the default) takes folder names and is fast. hidden shows the folders, and every switch or pull respects them.
Commands taught
git-sparse-checkoutLevel 214: The 400 MB folder
Objective: In ~/giants/site, remove build/ from all of history, delete the leftovers from disk, then ignore build/ for good.
Someone committed build/ (in real life 400 MB), and deleting it in a new commit doesn't help because history keeps it. filter-branch --index-filter rewrites every commit without it (on a real job: git filter-repo, not in this VM), so warn the team about the new hashes.
Commands taught
git-filter-branchLevel 215: Tools for giants
Objective: Try each tool once: a sparse clone in ~/giants, then rewrite ~/giants/split.
clone --sparse checks out only top-level files. filter-branch --subdirectory-filter DIR makes DIR the whole repo, history kept. A second filter-branch needs -f (the first left a backup in refs/original/). for-each-ref --format='%(refname)' lists refs.
Level 216: Since July
Objective: Clone file:///srv/git/chronicle.git into ~/giants/chronicle with only the commits since 2026-07-01.
git clone --shallow-since=DATE brings only the commits made after that date (hidden --shallow-since works too). Handy when you need 'this quarter' of history, not a fixed number of commits.
Level 217: One more floor
Objective: In ~/giants/mono (sparse: services/api), also check out libs/auth, then turn sparse-checkout off for a full test run.
git sparse-checkout add DIR adds a folder and keeps the others (set would REPLACE the list). hidden shows it. hidden puts every file back on disk (the list is kept for later).
Level 218: The tools move out
Objective: Make ~/giants/tools a repo whose root is the monorepo's tools/ folder, with only the commits that touched it.
To give a folder its own repo with its history: clone the monorepo somewhere new, then git filter-branch --subdirectory-filter tools -- --all makes tools/ the root and keeps only the commits that touched it. Then hidden.
Level 219: The runner is out of disk
Objective: Fast: make ~/giants/ci-api the slimmest clone of file:///srv/git/mono.git: one commit, blob:none, only services/api checked out.
CI clones on every push. Combine all three: --depth 1 (one commit), --filter=blob:none (only needed files), --sparse (only top-level files at first), then sparse-checkout set the folder the job builds.
Level 220: Raw photos on the server
Objective: Fast: remove media/raw from main's whole history in ~/giants/press and publish the clean main to origin.
When the bloat is already on the server: rewrite only your branch (-- main, not --all, so origin/main keeps showing the server's real tip), then hidden. Everyone else must re-clone or reset onto the new main.
Level 221: Taming Titan
Objective: Partial+sparse clone Titan, check out services/web and libs/ui, split libs/ui into ~/giants/ui, and purge its dist/ from that history.
Titan: ten teams, ten years, one repo. Clone it the light way, check out only your folders, and give libs/ui its own repo without the bundle someone committed.
World 22The Federation
12 levelsMany repos, one product: parallel worktrees, pinned submodules, merged subtrees, big binary files and a monorepo with owners.
Level 222: Two desks, one repo
Objective: Leave ~/fed/app mid-feature: open a worktree ~/fed/hotfix on a new branch hotfix/login from main, and fix and commit the misspelled prompt in login.sh there.
git worktree add PATH -b NEW-BRANCH START gives the same repo a second working folder on another branch. No stash, no re-clone: your half-done work stays where it is, and both folders share one .git (commits made in one are visible in the other).
Commands taught
git-worktreeLevel 223: A repo inside a repo
Objective: In ~/fed/game, add file:///srv/git/fonts.git as a submodule at vendor/fonts and commit it.
git submodule add URL PATH clones another repo into PATH and records a .gitmodules entry plus a 'gitlink': the exact commit it's pinned to. Commit both. (git blocks file:// submodules by default; this lab's ~/.gitconfig allows it.)
Commands taught
git-submoduleLevel 224: Clone the whole family
Objective: Clone file:///srv/git/game.git into ~/fed/game2 with its submodule filled in.
A plain git clone leaves submodule folders EMPTY; git clone --recurse-submodules URL fills them, each at its pinned commit (forgot, or a pull moved a pin? run hidden inside the clone).
Level 225: Adopt a repo, keep its story
Objective: In ~/fed/site, bring file:///srv/git/ui.git in under vendor/ui/ with its history (a subtree merge).
A subtree puts another repo INTO a folder of yours, history included. git subtree add isn't in this VM, so use the recipe it automates: merge -s ours --no-commit --allow-unrelated-histories (join histories), read-tree --prefix (place files), commit.
Commands taught
git-subtree-mergeLevel 226: Rules per file type
Objective: In ~/fed/tools, commit a .gitattributes making *.sh LF-only and *.png binary, with deploy.sh re-stored without its CRLF endings.
.gitattributes (committed) gives paths attributes: '*.sh text eol=lf' keeps scripts LF (CRLF breaks them on Linux), '*.png binary' means no diffs and no line-ending changes. hidden re-stores tracked files under new rules.
Commands taught
gitattributesLevel 227: Tools of the Federation
Objective: Try each tool once in ~/fed/band.
submodule update --init fills empty submodule folders after a plain clone. git -C DIR fetch --tags gets new tags without cd. worktree remove --force drops a worktree with changes (lost). hidden sends those files through LFS (simulated).
Commands taught
git-lfsLevel 228: Desk cleanup
Objective: From ~/fed/app2, remove the finished ~/fed/wt-done worktree properly and prune the stale ~/fed/wt-gone, keeping wt-review.
hidden shows every worktree. git worktree remove PATH deletes a finished one properly (it refuses if there are uncommitted changes). If someone just rm -rf'd a worktree folder, git still lists it as 'prunable': hidden forgets it.
Level 229: Move one pin
Objective: In ~/fed/game3, fetch every submodule with foreach, then move vendor/fonts to its tag v2 and commit. vendor/sfx stays on v1.
git submodule foreach CMD runs CMD in every submodule. To move a pin: check out the new commit inside the submodule, then git add its path in the parent and commit. hidden shows '+' while folder and pin disagree.
Level 230: Big files, small pointers (SIM)
Objective: In ~/fed/art, set up LFS with lfs-sim (install, track "*.psd") and commit .gitattributes and art/hero.psd as an LFS pointer.
Git LFS: .gitattributes sends a pattern through the 'lfs' filter, so git add stores a 3-line POINTER (version, oid, size) and the real file goes to .git/lfs/objects and the LFS server. git-lfs isn't in this VM: lfs-sim does the same locally (real filters, real pointers).
Level 231: The dead submodule
Objective: Fast: remove the vendor/legacy submodule from ~/fed/game4 completely (config, .gitmodules, stored repo) and commit. vendor/fonts stays.
Removing a submodule completely: git submodule deinit -f PATH (empties the folder, drops it from .git/config), git rm PATH (removes the gitlink and its .gitmodules entry), rm -rf .git/modules/PATH (its stored repo), commit.
Level 232: Two repos, one roof
Objective: Fast: bring file:///srv/git/billing.git into ~/fed/mono under billing/ with its history, and commit a CODEOWNERS giving /web/ to @mira and /billing/ to @dana.
Merge a repo into a monorepo with its history: the subtree recipe (or git mv everything into billing/ in a clone, then merge --allow-unrelated-histories). Then CODEOWNERS: '/billing/ @dana' makes the forge ask the right reviewer per folder.
Commands taught
monorepoLevel 233: Release night
Objective: Open a release/2.0 worktree, pin fonts to v2 there, commit sfx/theme.wav as an LFS pointer, push release/2.0, remove the worktree.
Release 2.0 tonight, and you're mid-feature. Release from a second worktree: move the fonts pin, add the theme music through LFS, push, then tidy the worktree away.
Final examThe Keeper's Exam
17 levelsSeventeen real repositories, ninety minutes, no hints: prove you can keep any history safe.
Level 234: Task 1: a new vault
Objective: Make ~/exam/vault a repository that ignores *.log files, and commit notes.md together with the .gitignore.
Exam rules: one clock, no hints. Every task is a real repository; only its final state counts.
Level 235: Task 2: the stage
Objective: In ~/exam/stage, take config.txt off the stage but keep its edit in the file, and throw away the edit to readme.md.
git restore --staged unstages; git restore discards a working-tree edit.
Level 236: Task 3: who did it
Objective: In ~/exam/blame, find who added the line 'timeout = 0' to settings.ini and tell Kern their name (kern <name>).
git blame shows, for each line, the commit and the author who last changed it.
Level 237: Task 4: branches
Objective: In ~/exam/branch, merge feature/menu into main (a fast-forward), delete feature/menu, and create a branch hotfix at the new main.
A merged branch can go; a new branch is just a new name at a commit.
Level 238: Task 5: the conflict
Objective: In ~/exam/conflict, merge feat-title into main. title.txt must end with feat-title's title (Kern's Kitchen) and keep the opening hours.
A conflict: edit the file to the final text, git add it, hidden.
Level 239: Task 6: undo a shared commit
Objective: In ~/exam/revert, everyone already pulled 'Break the prices'; undo it without rewriting history (keep 'Add tea').
Shared history is never rewritten: git revert adds a commit that undoes another.
Level 240: Task 7: a lost branch
Objective: In ~/exam/reflog, the branch experiment was deleted; bring it back with both of its commits.
hidden lists every commit HEAD stood on.
Level 241: Task 8: interrupted
Objective: In ~/exam/stash, commit a fix for the typo 'eruo' in prices.txt on branch hotfix, then return to main with your menu.txt edit uncommitted and an empty stash.
hidden shelves uncommitted work so you can switch; hidden brings it back.
Level 242: Task 9: one commit
Objective: In ~/exam/pick, bring only dev's 'Fix the oven timer' onto main.
git cherry-pick copies one commit onto the current branch.
Level 243: Task 10: the first bad commit
Objective: In ~/exam/bisect, hidden fails on main but passed on the first commit; find the first bad commit, tell Kern its hash (kern <hash>), and end the bisect.
git bisect run CMD tests each step for you; hidden ends the hunt.
Level 244: Task 11: rejected
Objective: In ~/exam/push/shop, publish your commit 'Add the dessert menu' to origin main without losing what Mira pushed meanwhile.
A rejected push means origin has commits you don't: integrate them first, then push.
Level 245: Task 12: a tracked secret
Objective: In ~/exam/untrack, stop tracking secrets.env (keep the file on disk), make git ignore it, and commit that.
git rm --cached removes a file from the repo but not from the disk.
Level 246: Task 13: fold the fixup
Objective: In ~/exam/autosquash on feature/search, fold the fixup commit into 'Add search' so two commits are left: Add search, then Add filters.
git rebase -i --autosquash puts every fixup! commit under its target for you.
Level 247: Task 14: a draft PR
Objective: In ~/exam/pr/bakery, fix oven.sh on branch fix-oven so CI passes (tests stay as they are), push it, and open a DRAFT pull request into main.
The forge runs CI on every push; forge pr create --draft opens a PR that is not ready for review yet.
Level 248: Task 15: a workflow
Objective: In ~/exam/actions/press, on a new branch add-ci, add .github/workflows/ci.yml running hidden on push, and push it: the run must be green.
A workflow: on, jobs, runs-on, steps with run. ci-lint checks it before you push.
Level 249: Task 16: a release
Objective: In ~/exam/tag/app, tag main as v1.2.0 with an ANNOTATED tag and push the tag to origin.
git tag -a makes an annotated tag (an object with a message); tags are pushed by name.
Level 250: Task 17: catch up
Objective: In ~/exam/upstream/lib (your fork), add /srv/git/upstream-lib.git as remote upstream, bring main up to date with it, and push main to origin.
origin is your fork, upstream is the original: fetch upstream, merge upstream/main, push to origin.
For teachers
Use these levels with a class
SOLUTION HIDDEN Teachers see answer keys in the classroom.