Reading History Like a Detective
A colleague asks: "When was the butter quantity added, and who last changed it?" Answer in under 30 seconds — tools only, no scrolling.
A colleague messages you: "The butter quantity in the cookie recipe changed — when was it first added, and what did it used to say?" Without the right tools, you would scroll through fifteen real commits by hand. With the right tools, this takes under thirty seconds.\n\nEvery question in this lab has a real, specific, genuinely correct answer sitting in this exact repository's real history — no guessing, no scrolling, tools only.
Q1: When Was "butter" First Mentioned?
git log -S butter --oneline -- cookies.md
The -S flag (git's "pickaxe" search) finds every real commit that changed how many times a string appears in a
file — not a text search through messages, a real search through actual file content across all of history.
Q2: Who Last Touched a Specific Line?
git blame -L 3,3 cookies.md
git blame genuinely attributes every line still present in the file to the real commit that last touched it — not necessarily the commit that first added the line, but the one currently responsible for its exact current content.
Q3: What Did It Look Like Several Commits Ago?
git show HEAD~2:cookies.md
HEAD~2 means "two commits before HEAD." Combined with :cookies.md, this shows the real, exact content of that
one file at that specific point in history — without touching the working directory or checking anything out.
git log -S (pickaxe search)
Searches real file content across all of history for commits that changed how many times a given string appears — genuinely different from searching commit messages, and confirmed directly in this lab to find the exact commit that first introduced a word.
git blame
Attributes every line currently in a file to the real commit that most recently changed it. Confirmed directly: a line touched by three different commits over time is attributed to the most recent of the three, not the first.
git show <hash>:<file>
Displays a file's real, exact content as of one specific commit, without checking anything out or touching the working directory — the direct, real way to answer "what did this look like back then."
📜 Confirm the Real Scale of This History
This project has grown for real across four lessons now. Confirm exactly how much history exists.
cd ~/recipes && git log --onelinestudent@lab:~$ cd ~/recipes && git log --oneline 7451729 (HEAD -> master) Increase butter back to 175g for a richer flavor 59cee07 Reduce butter to 150g per taste-test feedback 22779d0 Add butter quantity to cookie ingredients 9db68e6 Add variations note to cookie recipe dda949a Credit the recipe source in the cookie title c7a2617 Add step-by-step instructions to cookie recipe 8c8aee6 Add Belgian waffles recipe 5856011 Add basic garden salad recipe fd509ba asdf c764cd9 Add prep time estimates to all three recipes 1aa939c Add salt to taste note in soup recipe 56c4ee4 fixed stuff b5dba00 Add chicken noodle soup recipe cd7e65b Add ingredients list and pasta recipe 7fb33b3 Add chocolate chip cookie recipe
🔎 Find When Butter Was First Mentioned
Use git log -S to search real file content, not commit messages, for the word "butter".
cd ~/recipes && git log -S butter --oneline -- cookies.mdstudent@lab:~$ cd ~/recipes && git log -S butter --oneline -- cookies.md cd7e65b Add ingredients list and pasta recipe
👤 Find Who Last Touched the Butter Line
Use git blame to see which real commit is responsible for the ingredients line as it currently stands.
cd ~/recipes && git blame -L 3,3 cookies.mdstudent@lab:~$ cd ~/recipes && git blame -L 3,3 cookies.md 74517298 (Ada Lovelace 2026-01-01 02:40:00 +0000 3) Ingredients: flour, sugar, butter (175g), chocolate chips
⏳ See What It Said Two Commits Ago
Use git show to view the file exactly as it looked before the most recent butter change — without touching the working directory.
cd ~/recipes && git show HEAD~2:cookies.mdstudent@lab:~$ cd ~/recipes && git show HEAD~2:cookies.md Chocolate Chip Cookie Recipe (Grandma's) Ingredients: flour, sugar, butter (200g), chocolate chips Serves: 24 cookies Prep time: 15 minutes Instructions: 1. Cream the fat and sugar together. 2. Beat in the eggs one at a time. 3. Mix in the flour and chocolate chips. 4. Drop spoonfuls onto a baking sheet. 5. Bake at 190C for 10-12 minutes. Variations: add walnuts, or swap half the chocolate chips for M&Ms.
Lab 1.2.4 complete — Block 1.2 complete. A real 15-commit mystery, fully solved with tools alone:\n\n\n Real history scale confirmed : ✅ 15 genuine commits\n "butter" first mention found : ✅ git log -S\n Last-touched commit found : ✅ git blame\n Historical content recovered : ✅ git show HEAD~2:file\n
Enable JavaScript to run the live terminal and track your progress.