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

SectionTimeRequired?
Watch10 min⚑ Required
The three states of a file5 min⚑ Required
Good commit messages5 min⚑ Required
Reflect10 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:

StateWhat it means
WorkingYou have made changes but not told Git about them yet
StagedYou have run git add — Git knows about the changes and is ready to include them in the next commit
CommittedThe 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.

DoDon't
Add readme fileAdded readme file
Fix broken link in headerFixes broken link
Remove unused CSSRemoving 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

LevelYou can...
🪨Intro ClimbWrite a commit message in imperative present tense⚑ Required
🧗Core AscentMake separate commits for separate changes with clear messages⚑ Required
🏔️SummitExplain the three file states (working, staged, committed) without notes◎ Optional

Reflect

Add your answers to the same document as your previous reflections.

  1. 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.