-S: When Did This Word First Appear?
git log --oneline -S saffron -- .
The "pickaxe" searches every real commit's actual diff for a string being added or removed — not just commit messages. It finds the one real commit that changed the count of that string in the file, which is exactly "when it was introduced" for a brand-new word.
--since / --until: What Changed in This Window?
git log --oneline --since="2026-01-02T19:35:00+00:00" --until="2026-01-02T19:55:00+00:00" -- kitchen-tips.md
Restricts real history to a specific real date range, on a specific real file — exactly "what landed here between these two moments."
--follow: Across a Real Rename
git log --follow --oneline -- oven-roast-chicken.md
A plain git log -- <file> stops dead at a rename, because as far as a plain lookup is concerned the file didn't exist before that point. --follow genuinely keeps tracing backward through the rename, into the file's real history under its old name.
-L: One Block's Entire Real History
git log -L /case/,+7:check-times.sh --oneline
Instead of a whole file, -L tracks one real region — a function, a block, a specific range — showing every real commit that actually touched those exact lines, with a real diff scoped to just that region each time.
git log defaults to a simple, linear scroll — but it is genuinely a full search engine over every real commit ever made, once you reach for the right flag. This lab asks four real, different questions about the same repository, each one built for a specific real git log flag: when did a particular word first show up, what changed to one file in a specific real window of time, where did a file's history go after it was renamed, and which real commits touched one specific block of code.
git log -S<string>
The "pickaxe" — finds real commits that changed how many times a string appears in the diff. Confirmed directly in this lab: it found the exact single commit that introduced a brand-new ingredient, out of dozens of unrelated ones.
git log --follow
Keeps tracing a file's real history across renames, which a plain git log -- <file> cannot do. Confirmed directly in this lab: it revealed two real commits that happened entirely under the file's old name.
git log -L <range>:<file>
Tracks one real block of a file across its entire history, showing a real, scoped diff for every commit that touched it. Confirmed directly in this lab: it surfaced two genuinely separate revisions of the same validation logic.
Takeaways
- git log -S<string> finds real commits that changed how many times a string appears — "when was this introduced"
- git log --since/--until restricts real history to a specific time window, optionally scoped to one file
- git log --follow keeps tracing a file's real history across renames that a plain lookup would stop at
- git log -L <range>:<file> tracks one real block's history with a diff scoped to just that region each time