RadarTrek
Home/Courses/Git & GitHub/Commits: The Snapshot Mental Model
Lesson 02 / 8·6 minFree

Commits: The Snapshot Mental Model

How Git actually thinks about your project — before any commands

Most Git confusion comes from not having the right mental model. Get this right and every command will make intuitive sense.

Your project is a timeline

Every commit is a complete snapshot — you can go back to any point a1b2c Initial commit e4f5a Add homepage b7c8d Fix mobile nav f1a2b Add dark mode HEAD Latest HEAD

Every dot on this line is a commit — a complete snapshot of your project at that moment in time. The arrows show the order. The labels describe what changed.

A commit is not just a diff

It's tempting to think Git saves only what changed between versions. Technically it stores things efficiently, but conceptually a commit is a complete, self-contained snapshot of every file in your project.

!

Why this matters

Because you can checkout (go to) any commit and see your entire project exactly as it was at that point. Not just the changes — the whole thing.

The commit hash

Every commit gets a unique identifier — a long hexadecimal string like `a1b2c3d4e5f6...`. You'll usually see just the first 7 characters. This hash is how Git identifies every snapshot uniquely, forever.

Example git log output

commit a1b2c3d (HEAD -> main)
Author: You <you@example.com>
Date:   Mon Jun 2 14:22:33 2026

    Add dark mode toggle

commit e4f5a6b
Author: You <you@example.com>
Date:   Sun Jun 1 10:15:07 2026

    Fix navigation on mobile

What HEAD means

HEAD is just a pointer to where you currently are in the timeline. Usually it points to the latest commit on your current branch. When you make a new commit, HEAD advances to it automatically.

!

Think of HEAD as "you are here"

On a map, there's a dot showing where you are. In Git, HEAD is that dot. It moves forward as you commit, and you can manually move it to look at older snapshots.

What makes a good commit message

Your commit messages are the labels on the timeline. In six months you'll rely on them to understand what happened and why. Good messages are short, specific, and describe what and why — not how.

  • Good: "Add user authentication with email/password"
  • Good: "Fix mobile menu not closing on outside click"
  • Bad: "Updates"
  • Bad: "WIP"
  • Bad: "asdfg"
!

Conventional commits (optional but popular)

Many teams prefix messages: feat: for new features, fix: for bug fixes, docs: for documentation, refactor: for code changes that don't add features. Example: "feat: add dark mode toggle"

RadarTrek Intel — monthly score updates

We track 40+ tools so you don't have to. Score changes, new tools, and new guides — once a month, no spam.