git commit — Saving Snapshots
git commit permanently saves your staged changes as an immutable snapshot in history. Each commit gets a unique SHA-1 hash, stores your name, email, timestamp, message, and a pointer to the parent commit.
01.Anatomy of a Good Commit Message
Write commit messages in imperative mood, present tense: "Add login form" not "Added login form". Keep the subject line under 72 characters. Add a blank line, then a body explaining WHY (not what — the diff shows what). Reference issue numbers: "Fix crash on logout (closes #42)".
02.Commits Are Snapshots, Not Diffs
Git stores complete file snapshots per commit — not just what changed. This makes operations like branch switching instantaneous regardless of history length. The diff you see in git log is computed on-the-fly by comparing two consecutive snapshots.
Commands
What does Git store in each commit object?