Practice center
Choose the tool yourself
Do not identify the lesson first. Decide based on the problem. For each, name the affected state and one verification command. Lesson challenges and capstones are checked in a real sandbox; mixed scenarios are answered and self-checked against the key (handbook p. 94).
40 problems
- Mixed scenarioThree trees · 5 min
Save only the staged version
You staged v2, then edited v3. Save only v2.
Self-checked
- Mixed scenarioUndo · 5 min
Undo a published commit
Your published commit broke production. Undo its effect.
Self-checked
- Mixed scenarioRemotes · 5 min
Inspect changes without integrating
The server advanced while you were editing. Inspect without integration.
Self-checked
- Mixed scenarioWorktrees · 5 min
Hotfix during a running build
You need to fix a hotfix without disrupting a running build.
Self-checked
- Mixed scenarioRecovery · 5 min
A detached commit vanished
A detached commit vanished after a switch.
Self-checked
- Mixed scenarioRecovery · 5 min
A staged file disappeared
An uncommitted staged file disappeared in a reset.
Self-checked
- Mixed scenarioConflicts · 5 min
Inspect the incoming side of a conflict
A conflict shows stages 1, 2 and 3. Inspect incoming content.
Self-checked
- Mixed scenarioCollaboration · 5 min
Rewrite without overwriting a colleague
A private branch rewrite may overwrite a colleague's tip.
Self-checked
- CapstoneCapstone · 45–60 min
build a repository with plumbing
Add a third plumbing-only commit that removes src/app.txt while retaining readme.txt.
Verified in a sandbox
- CapstoneCapstone · 45–60 min
simulate team collaboration and conflicts
Clone the final server into a third directory and verify the configuration and history independently.
Verified in a sandbox
- CapstoneCapstone · 45–60 min
disaster recovery and final assessment
Explain which data cannot normally be recovered through Git after a hard reset and propose a prevention strategy.
Self-checked
- Lesson challengeFoundations · 5–10 min
Why version control exists
Create a third version, then inspect the first without switching branches.
Verified in a sandbox
- Lesson challengeFoundations · 5–10 min
Your first repository and commit
Ignore notes.txt without deleting it, and commit the ignore rule.
Verified in a sandbox
- Lesson challengeFoundations · 5–10 min
The big picture of Git architecture
Find the object ID of app.txt in the Index and inspect it with cat-file.
Verified in a sandbox
- Lesson challengeStorage · 5–10 min
Snapshots versus changes
Rename b.txt without changing its bytes; commit and compare the old and new blob IDs.
Verified in a sandbox
- Lesson challengeStorage · 5–10 min
Hashing and blob objects
Use printf to store a new blob and prove it exists without staging a path.
Verified in a sandbox
- Lesson challengeStorage · 5–10 min
Trees and directory structures
Change the executable bit of README.md in the Index without changing its bytes; compare tree IDs.
Verified in a sandbox
- Lesson challengeStorage · 5–10 min
Commit objects and immutability
Create a second ordinary commit and find its parent using cat-file and rev-parse.
Verified in a sandbox
- Lesson challengeStorage · 5–10 min
Building a commit from scratch
Use plumbing to create a second commit with app.txt v2 and the first commit as its parent.
Verified in a sandbox
- Lesson challengeThree trees · 5–10 min
Working directory, Index and HEAD
Commit version 3 separately; verify all three states now agree.
Verified in a sandbox
- Lesson challengeThree trees · 5–10 min
What add and commit actually do
Stage second, then inspect the new object ID before committing; compare with b.
Verified in a sandbox
- Lesson challengeThree trees · 5–10 min
Understanding status and diff
Stage v3 and confirm the unstaged diff is empty while the staged diff shows v1 to v3.
Verified in a sandbox
- Lesson challengeThree trees · 5–10 min
Selective staging and restoring changes
Create a file with two far-apart changed lines, use git add -p to stage one hunk, and inspect both diffs.
Verified in a sandbox
- Lesson challengeBranches · 5–10 min
Commit graphs and movable references
Find the common ancestor and prove that feature and main have different tips.
Verified in a sandbox
- Lesson challengeBranches · 5–10 min
HEAD and detached HEAD
Detach at the rescue branch and prove that HEAD resolves but is not symbolic.
Verified in a sandbox
- Lesson challengeBranches · 5–10 min
Tags and revision syntax
Merge feature into main, inspect the two parent IDs, and identify HEAD^2 and HEAD~2.
Verified in a sandbox
- Lesson challengeBranches · 5–10 min
Stash, shelving and worktrees
Stage a change and add an untracked file, stash with -u, inspect three parents, and apply with --index.
Verified in a sandbox
- Lesson challengeIntegration · 5–10 min
Fast-forward and three-way merging
Draw the graph before and after the second merge and explain where each ref points.
Self-checked
- Lesson challengeIntegration · 5–10 min
Understanding and resolving conflicts
Repeat in a fresh lab but resolve by choosing the incoming file; explain why choosing a side requires product knowledge.
Verified in a sandbox
- Lesson challengeIntegration · 5–10 min
Cherry-picking
Compare the two fix commits' patches and parents.
Verified in a sandbox
- Lesson challengeIntegration · 5–10 min
Rebasing and interactive rebasing
Create two local commits on feature; run git rebase -i HEAD~2 and reword or squash the last commit.
Verified in a sandbox
- Lesson challengeIntegration · 5–10 min
Reset, revert and amend
Choose an undo strategy for a wrong published commit and for a typo in an unpublished tip message.
Self-checked
- Lesson challengeRemotes · 5–10 min
Cloning and remote repositories
Create a local branch in the clone and prove it is not automatically present on the server.
Verified in a sandbox
- Lesson challengeRemotes · 5–10 min
Fetch, pull and push
Explain what would happen if your main also had a unique commit before the fetch.
Self-checked
- Lesson challengeRemotes · 5–10 min
Upstream branches and refspecs
Create a local branch review and publish it as another remote branch review-copy without renaming it.
Verified in a sandbox
- Lesson challengeRemotes · 5–10 min
Team collaboration and safe force-pushing
Simulate a teammate updating the server before a lease using the previously recorded old ID.
Verified in a sandbox
- Lesson challengeRecovery · 5–10 min
Packfiles and delta compression
Inspect an old version after packing and explain how the same logical object can have a different physical representation.
Verified in a sandbox
- Lesson challengeRecovery · 5–10 min
Reachability and garbage collection
Explain why deleting a branch already merged into main might not change reachability at all.
Self-checked
- Lesson challengeRecovery · 5–10 min
Reflog, fsck and disaster recovery
Without using the saved blob variable, locate the correct unreachable blob by inspecting candidates from fsck.
Verified in a sandbox
- Lesson challengeRecovery · 5–10 min
Debugging history with bisect and blame
Inspect the suspected commit and explain which test should guard against the regression.
Verified in a sandbox
Want to experiment without a goal? Use the free playground: nothing there counts as mastery evidence.