A hands-on collection of Git exercises with an interactive CLI tool.
This opens an interactive menu where you can browse and set up exercises with arrow keys.
python workshop.py --list # List all exercises
python workshop.py 3 # Set up exercise 3 directly
No external Python packages needed.
- Run
workshop.py and pick an exercise
- The tool creates a pre-configured git repository in the exercise's
exercise/ folder
cd into the exercise/ directory
- Follow the instructions in the exercise's
README.md
Part 1: Creating Snapshots
| # |
Exercise |
Concepts |
| 01 |
Init and Status |
git init, git status |
| 02 |
Staging and Committing |
git add, git commit |
| 03 |
Viewing Changes |
git diff, git diff --staged |
| 04 |
Ignoring Files |
.gitignore |
| 05 |
Undoing Local Changes |
git restore, git clean |
| # |
Exercise |
Concepts |
| 06 |
Browsing History |
git log, git show, filtering |
| 07 |
Detached HEAD |
git checkout <hash> |
| 08 |
Blame and Tagging |
git blame, git tag |
| 09 |
Bisect |
git bisect |
Part 3: Branching & Merging
| # |
Exercise |
Concepts |
| 10 |
Creating Branches |
git branch, git switch |
| 11 |
Stashing |
git stash |
| 12 |
Fast-Forward Merge |
git merge (fast-forward) |
| 13 |
Three-Way Merge |
git merge (diverged branches) |
| 14 |
Merge Conflicts |
Conflict resolution |
| 15 |
Rebasing |
git rebase |
| 16 |
Cherry Picking |
git cherry-pick |
| # |
Exercise |
Concepts |
| 17 |
Cloning and Fetching |
git clone, git fetch |
| 18 |
Pushing and Pulling |
git push, git pull |
| 19 |
Remote Branches |
git push -u, git branch -r |
Part 5: Rewriting History
| # |
Exercise |
Concepts |
| 20 |
Amend |
git commit --amend |
| 21 |
Reset |
git reset --soft/--mixed/--hard |
| 22 |
Revert |
git revert |
| 23 |
Interactive Rebase |
git rebase -i |
| 24 |
Reflog |
git reflog |
To remove all exercise working directories:
find exercises -name "exercise" -type d -exec rm -rf {} +