Committing What's Staged
git commit -m "Add chocolate chip cookie recipe"
[master (root-commit) 21d6f97] Add chocolate chip cookie recipe
1 file changed, 1 insertion(+)
create mode 100644 cookies.md
git confirms the branch (master), a real short hash (21d6f97), your message, and a real summary of what
changed — one file, one insertion.
Reading It Back
commit 21d6f97ab753653b869ef787fdd05c86ea77527f (HEAD -> master)
Author: Ada Lovelace <ada@example.com>
Date: Mon Aug 24 19:31:24 2026 +0000
Add chocolate chip cookie recipe
Every field here is genuinely real: the full 40-character hash (uniquely identifying this exact snapshot, forever),
the author identity you configured back in Lesson 1.1.1, the real timestamp, and your message.
Confirming It's Clean
On branch master
nothing to commit, working tree clean
"Clean" is git's real word for "everything currently on disk matches the last commit exactly." This is the state
you genuinely want to see before walking away from a project.
Your recipe file is staged, exactly where the last lab left it — genuinely not yet safe. This lab closes that gap: a real git commit, and a real look at exactly what git recorded.
Unlike a word processor's save button, which quietly overwrites the same file every time, a commit genuinely never overwrites anything. Each one is a new, permanent, addressable snapshot — with a real author, a real timestamp, and a real hash uniquely identifying it, confirmed directly with git log rather than taken on faith.
git commit
Takes everything currently staged and writes it as a new, permanent, addressable snapshot in the repository's real history — identified by a real hash, never overwritten by a later commit.
git log
Reads real commits directly out of the repository's history, newest first — each with its real hash, author, date, and message, exactly as git recorded them at commit time.
"working tree clean"
git's exact real phrase for "every file on disk currently matches the last commit exactly" — no untracked files, no staged changes, no unstaged edits.
Takeaways
- git commit -m writes everything currently staged as a real, permanent, addressable snapshot — identified by its own unique hash
- git log reads real commits directly from the repository's history — newest first, each with its real author, date, and message
- A commit is never overwritten by a later one — both genuinely coexist in history forever, unlike a save button
- "nothing to commit, working tree clean" is git's exact real phrase for "disk and last commit now match exactly"
- This closes the loop from Lesson 1.1.3: staged was genuinely not safe; committed genuinely is