Track and Commit Primer
The Big Idea
Every time you finish a meaningful piece of work, you commit it. A commit is a save point you can return to. Good commit messages make your history readable — to you, to your team, and to future employers.
Your Roadmap
| Section | Time | Required? |
|---|---|---|
| Watch | 10 min | ⚑ Required |
| The three states of a file | 5 min | ⚑ Required |
| Good commit messages | 5 min | ⚑ Required |
| Reflect | 10 min | ⚑ Required |
Watch
Git Track and Commit (8 min)
The three states of a file
Every file in a Git repository is in one of three states:
| State | What it means |
|---|---|
| Working | You have made changes but not told Git about them yet |
| Staged | You have run git add — Git knows about the changes and is ready to include them in the next commit |
| Committed | The snapshot has been saved — the changes are part of your history |
git status tells you which state each file is in. Run it often.
Good commit messages
Write commit messages in the imperative present tense — as if you are giving the codebase an instruction.
| Do | Don't |
|---|---|
Add readme file | Added readme file |
Fix broken link in header | Fixes broken link |
Remove unused CSS | Removing some stuff |
Keep each commit focused on one change. If you fixed a typo and added a new section, make two commits — not one. This keeps your history readable and makes it easy to undo a specific change if something goes wrong.
Commit often. Every time something works, commit it. Small, frequent commits are better than large, infrequent ones.
How to know you've nailed it
| Level | You can... | ||
|---|---|---|---|
| 🪨 | Intro Climb | Write a commit message in imperative present tense | ⚑ Required |
| 🧗 | Core Ascent | Make separate commits for separate changes with clear messages | ⚑ Required |
| 🏔️ | Summit | Explain the three file states (working, staged, committed) without notes | ◎ Optional |
Reflect
Add your answers to the same document as your previous reflections.
- How would you describe stage and commit to your non-tech savvy friend?
The Big Idea (revisited)
A commit is a save point. Stage your changes with git add, commit them with a clear message, and do it often. Your commit history is a record of your work — make it readable.