Reading History
Open One Commit
A history gives you signposts. One message in the Fern & Fig history says make the heading green. That is useful, but it is still a claim. You want to see what the
Show the commit
git show opens one commit. Give it a commit identifier and it prints the commit’s author, date, and message, followed by the difference between that snapshot and its parent.
The short identifier 40d8e6e names the commit whose message says the heading became green. Run:
git show 40d8e6e
The first part should feel familiar from git log. It tells you which commit you opened, who made it, when, and why they said they made it.
The second part begins with diff --git. This is the evidence.
Read the changed lines, not every symbol
A Git diff contains some labels that look dense because they must work for every kind of text file. For a first reading, four parts matter:
--- a/style.csslabels the older version of the file.+++ b/style.csslabels the newer version.The line beginning with
@@says where this small changed section belongs. This section is called a hunk. You do not need to decode its numbers yet.Lines beginning with
-were in the older snapshot but not the newer one. Lines beginning with+are in the newer snapshot but not the older one.
Lines with a blank space at the start are unchanged context. Git includes them to show you where the edit sits. In this commit, the existing body rule is context and the new h1 rule is the only added line:
body { font-family: system-ui; margin: 2rem; }
+h1 { color: #2e5b3e; }
The + is Git’s marker. It is not a character stored in style.css.
Check the message against the evidence
The message said the heading became green. The added CSS rule selects h1, the page’s main heading, and gives it the color #2e5b3e. The evidence agrees with the message.
That small check is the habit git show is for. Do not ask only, “What does the message say?” Ask, “Do the changed lines support it?”
In the diff from git show 40d8e6e, what does the line beginning with + mean?
git show answers a focused question about one commit. Sometimes your question is wider: how did the project differ between any two points? That is where git diff takes over.