Reading history: messages, diffs and blame
How to open a file's history, read a diff line by line and use blame to trace any line back to its commit, pull request and issue.
Lesson 3 of 3~24 min of learningIncludes ~14 min for questions and tasks
Contents1 of 49 steps
Alex Tutor
config/prices.json. In the top right corner of the file there's a History button. It lists every commit that ever changed this one file.You
Alex Tutor
git log.Alex Tutor
Question 1
You need every change made to config/prices.json this year. What do you open?
Alex Tutor
main; only the two highlighted ones touched config/prices.json.Alex Tutor
5b8f3a2Update cat food photos77c1e90Add express delivery price9d04e61Fix typo in footera41c09eRaise delivery price to 59 UAHe7c3b19Add summer promo bannerf02a6d4Update FAQ answersmain
Commit graph, oldest first: Last six commits on `main` 1. commit 5b8f3a2 on main "Update cat food photos" 2. commit 77c1e90 on main "Add express delivery price" (highlighted) 3. commit 9d04e61 on main "Fix typo in footer" 4. commit a41c09e on main "Raise delivery price to 59 UAH" (highlighted) 5. commit e7c3b19 on main "Add summer promo banner" 6. commit f02a6d4 on main "Update FAQ answers"
You
Alex Tutor
Alex Tutor
a41c09e.Alex Tutor
You
Alex Tutor
+1 −1: lines added and removed. And a Split view puts the old version on the left and the new one on the right, if that reads easier.Alex Tutor
Question 2
Match each part of a diff with its meaning.
Tap an answer, then tap the row it belongs to. You can also drag.
- A red line starting with
- - A green line starting with
+ - A grey line with no sign
+12 −3above a file
Answers left to place
Alex Tutor
You
Alex Tutor
You
Alex Tutor
Alex Tutor
Question 3
Here is the diff of pages/faq/delivery.md:
## Delivery
-Orders arrive in 2–3 days.
+Orders arrive in 1–2 days in Kyiv and 2–4 days elsewhere.
Free delivery from 1000 UAH.
+Express delivery: 99 UAH.
Which statements are true? Select all that apply.
You
Alex Tutor
Code to Blame. Next to every line GitHub shows the last commit that changed it: author, message and date, plus a colour strip from older to newer.You
Dmytro
Alex Tutor
git blame; on GitHub it's one button.Alex Tutor
Question 4
In the Blame view, what does GitHub show next to each line?
Alex Tutor
"delivery": 59 shows commit a41c09e. Its message ends with (#128), the pull request. And the PR says "Closes #120", the issue finance opened.Alex Tutor
a41c09e Raise delivery price to 59 UAH
What changed, who and when (found with Blame)
Raise delivery price after courier rate change#128
The discussion: why, who reviewed it, when it was merged
Courier rates up from 1 June#120
Where the request came from: finance
You
Alex Tutor
Dmytro
(#128) and write Closes #120 in pull requests. Without those links the trail stops at the commit, and you're back to asking around.Alex Tutor
Question 5
Put the steps in order to find out why a line in config/prices.json looks the way it does.
Tap an item, then tap where it should go. You can also drag or use the arrows.
Dmytro
You
Alex Tutor
View blame prior to this change. It shows the same file as it was just before that commit. Or open the file's History and look one step further back.Alex Tutor
Question 6
Blame on the line "freeDeliveryFrom": 1000 shows the commit "Reformat prices.json", which only changed indentation. How do you find the commit that actually set the value to 1000?
Alex Tutor
You
Alex Tutor
Dmytro
Alex Tutor
Question 7Short answer · AI-checked task
From the history you found: commit a41c09e "Raise delivery price to 59 UAH" (merged on 3 June), PR #128 "Raise delivery price after courier rate change", issue #120 "Courier rates up from 1 June" opened by finance. Write a 2–3 sentence answer support can send to a customer asking why delivery now costs 59 UAH instead of 49.
Write your answer and get a score with feedback from our AI reviewer.
Log in to get AI feedbackHistory for every change to a file, the diff for exactly what changed, Blame for where a line came from, and the linked pull request and issue for why.You
Dmytro