Code Katas
Focused, repeatable Git exercises designed to build fluency. Do these in throwaway repositories until the inspection and command sequence feel automatic.
Use these as retrieval prompts over the required labs, not five additional projects. Repeat weak steps on fresh inputs; the stated times are planning suggestions. Katas 6–7 are optional depth.
Kata 1: Build a Clean First History
Planning allowance: 15 minutes
Goal: Move from git init to a clean two-commit history
Setup: Empty folder
Tasks:
- initialize a repository
- create one file and commit it
- change the file and commit again
- show the history with
git log --oneline --graph --decorate
Repeat until: You can do it without looking up the command order.
Kata 2: Split One Messy File into Two Commits
Planning allowance: 20 minutes
Goal: Use the index intentionally
Setup: One file with two unrelated edits
Tasks:
- inspect with
statusanddiff - stage only one logical edit
- commit it
- stage and commit the remaining edit
Repeat until: You can explain what is in the working tree and index at each step.
Kata 3: Branch, Rebase, and Read the Graph
Planning allowance: 20 minutes
Goal: Understand how local history changes under rebase
Setup: Repository with main
Tasks:
- create a feature branch
- make two commits
- add one commit on
main - rebase the feature branch onto
main - inspect the graph and explain what changed
Repeat until: You can say why the final content may match a merge but the history differs.
Kata 4: Trigger and Resolve a Conflict
Planning allowance: 20 minutes
Goal: Remove fear around conflict markers
Setup: Two branches editing the same lines
Tasks:
- create divergent edits
- merge branches
- resolve the conflict manually
- complete the merge and inspect the result
Repeat until: Conflict markers no longer feel surprising.
Kata 5: Recover with Stash and Reflog
Planning allowance: 20 minutes
Goal: Practice safe recovery moves
Setup: Throwaway repository with two commits
Tasks:
- create uncommitted work and stash it
- follow the soft-reset recovery drill, preserving the index and files
- inspect reflog
- recover the earlier state
- reapply the stash
Repeat until: You can explain which layer changed at each step.
Completion Standard
- Can explain and demonstrate each core state transition; no speed cutoff
- Can explain the state transitions, not just run the commands
- No longer need to guess what
status,diff, andlogwill show next
Additional Fluency Katas
Kata 6: Remote-Tracking Diagnosis
Planning allowance: 12 minutes
Goal: Predict remote and local branch state after fetch/push operations
Tasks:
- create a bare remote and two clones
- push a branch from clone A
- fetch from clone B without checking out the branch
- write what
origin/<branch>points to - push one new commit from clone A and explain why clone B is stale until it fetches
Kata 7: Reviewable Rebase
Planning allowance: 18 minutes
Goal: Clean a local branch without hiding risk
Tasks:
- make four local commits: feature, typo, feature, debug
- use interactive rebase to squash typo commits and drop the debug commit
- verify the repository’s actual intended behavior or file-content contract; a placeholder test is not evidence
- write the final pull request description from the cleaned history
Repeat until: You can state the difference between cleaning private history and rewriting shared history without hesitation.