$ Git Game

Teach Git with a game

Students push before they pull, can't see the layers between their editor and the remote, and are afraid of losing work. In Git Game each of those happens to them inside a minute, in Git's own words, with nothing to install and no account to make. Here is a 45-minute lesson, what to say at each step, and a deck to print.

What they can say afterwards

The lesson, 45 minutes

  1. 15 minutes: the guided game

    Everyone opens gitgame.online/play on anything with a browser and taps play the bot. The first game is guided: one thing highlighted and one sentence per step, for the first days. Days last 60 seconds, and a day ends early once both packs are in, so twelve days take about ten minutes. Then two minutes: who saw ! [rejected], and what did the bot say it was doing?

  2. 20 minutes: a room, then the replay

    One student opens a room and shares its link; that link is the whole invitation, three to five seats, bots in any left empty, 60-second days. Twelve minutes of play. Then put one game's replay on the screen, day by day, and stop at the first rejection, the first conflict, the first push --force: what did Git say, and why?

  3. 10 minutes: the map

    What happened in the game, what it is in Git, and where to read more, from the table below. End on the question the game can't answer for them: what would you have done in a real repository?

Homework, if you like: a room on 24-hour days. Seven days, one pack a day, reminders if they ask for them, and a week of thinking about a push before making it.

The map

In the game In Git Read
Your push was rejected A non-fast-forward: someone's commit reached main first My push was rejected
The pull chose whose lines win A merge conflict, settled by -X ours or -X theirs Merge conflict
A push --force erased a commit A forced update; the reflog brings it back Someone force-pushed over my commit
CI flipped a bug; someone played blame git blame, git bisect Who broke main
A revert on a bug git revert: a commit that undoes a commit Undo a commit that's on main

Why it works on the things that are hard to teach

Running it

The deck, to print

The game began on paper, and the paper version is free to print: sixteen US Letter pages, nine poker-size cards to a page. Sixty commit cards, twelve of them bugs, the command cards, the incidents, a token sheet and a one-page reference. Three to five players, about 45 minutes, and it has cards the online game doesn't play yet, bisect, cherry-pick, stash among them, which is a lesson in itself.

download the deck (PDF) the rules

The deck and the text of these pages are under CC BY-SA 4.0: copy it, change it, print it for a class or a paid workshop; keep the licence and say where it came from.

Open a room for your class

open a room