Git labs - 25 hands-on challenges
Solve 25 real Git challenges in an isolated container in your browser. No setup, no fake shells.
- Your First Repository - beginner · Turn a folder into a Git repo and make your first commit.
- Stage the Right Files - beginner · Use the staging area to commit only what you mean to.
- Ignore the Junk - beginner · Write a .gitignore so build artifacts and logs stay out of history.
- Branch & Merge - intermediate · Create a feature branch, commit to it, and merge it back into main.
- Undo the Bad Commit - intermediate · A commit added a security backdoor — undo it cleanly.
- Amend the Last Commit - beginner · Fix the most recent commit without creating a new one.
- Tag a Release - beginner · Mark a commit as a version with an annotated tag.
- Prune Merged Branches - beginner · Delete branches that are already merged, keep the rest.
- Restore a File - beginner · Roll a file back to its committed version.
- Clean Untracked Files - beginner · Remove untracked junk safely.
- Resolve a Merge Conflict - intermediate · Fix a conflicted merge and complete it.
- Cherry-pick a Hotfix - intermediate · Copy one commit from another branch.
- Squash Messy Commits - intermediate · Combine several WIP commits into one.
- Revert a Specific Commit - intermediate · Undo one old commit, keep the rest.
- Stash, Branch & Commit - intermediate · Move uncommitted work onto a new branch.
- Remove a Committed Secret - intermediate · Untrack a leaked secret and ignore it.
- Soft Reset - intermediate · Uncommit but keep your changes staged.
- Pinpoint a Commit - intermediate · Find when a line of code was introduced.
- Escape Detached HEAD - intermediate · Save your work from a detached HEAD.
- Recover with reflog - advanced · Bring back a commit lost to a hard reset.
- Rebase onto main - advanced · Replay your branch for a linear history.
- Find the Bad Commit - advanced · Track down the commit that introduced a bug.
- Write a pre-commit Hook - advanced · Automate a guardrail before every commit.
- Linked Worktree - advanced · Check out two branches at once.
- Apply a Patch - advanced · Apply a colleague's patch file.