Making Your First Commit

Commit the staged recipe, and see exactly what a permanent snapshot looks like — not a save button, a checkpoint with a real identity.

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.\n\nUnlike 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.

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

git log
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

git status
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.

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.

📸 Make Your First Real Commit

Commit the staged recipe file with a clear, real message.

cd ~/recipes && git commit -m 'Add chocolate chip cookie recipe'

student@lab:~$ cd ~/recipes && 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

📜 Find Your Commit in the Log

Run git log and read the real details git recorded about your commit.

cd ~/recipes && git log

student@lab:~$ cd ~/recipes && git log commit 21d6f97ab753653b869ef787fdd05c86ea77527f (HEAD -> master) Author: Ada Lovelace <ada@example.com> Date: Mon Aug 24 19:31:24 2026 +0000 Add chocolate chip cookie recipe

✨ Confirm the Working Tree Is Clean

Run git status one more time and see git's exact phrase for "everything matches the last commit".

cd ~/recipes && git status

student@lab:~$ cd ~/recipes && git status On branch master nothing to commit, working tree clean

Lab 1.1.4 complete — Block 1.1 complete. A real commit, made and verified end to end:\n\n\n Committed : ✅ real hash assigned\n Found in git log : ✅ real author, date, message\n Working tree clean : ✅ confirmed by git status\n

Enable JavaScript to run the live terminal and track your progress.