Version Control

commit

A commit is a saved snapshot of your changes, stamped with a short message explaining why you made them. It's the moment you tell git 'remember the project exactly like this' — a checkpoint you can always return to.

Commits are the building blocks of history. String them together and you get a timeline of the whole project: each one knows what changed, who made the change, when, and the reason in their own words.

The message matters more than beginners expect. Six months later, a clear note like 'fix login crash on empty password' is a gift to your future self; 'stuff' or 'asdf' helps no one. Write the why, not just the what.

$ git commit -m "fix login crash on empty password"
[main 9f2a1c3] fix login crash on empty password

Save a snapshot with a message. That short line becomes part of the project's story.

That 9f2a1c3 is the commit's unique ID (a hash) — a permanent address you can always point back to.

Also called
git commitsnapshotrevision