Lesson 17 · Everyday work
Follow a file's history and line authorship
Attribute the README review line to Maya and the footer reminder to Leo, using file history and blame without treating authorship as code approval.
- Level: Intermediate
- 6 min read
- 5 min video
- Updated
- Before this lesson: Ignore files and clean untracked work safely
Progress saved in this browser.
Playing loads the video from YouTube (privacy-enhanced mode).
What you will learn
- Separate file history from current line attribution.
- Read author and committer independently.
- Inspect earlier blame without checking out commits.
- Keep attribution evidence separate from security trust.
Before you start
Start where lesson 15 ended: main with the ignore commit, clean; README.md is still the original README, and index.html contains Leo's footer from lesson 11. The published feature and the v0.1.0 tag are unchanged.
The video was recorded with Git 2.52.0 and GitTree 2.0 on Ubuntu 24.04: README.md was saved in the app, Maya's commit was made natively as teammate preparation, and the history and blame views were opened in the app; the before state and the blame readbacks ran in the terminal. Nothing was run on macOS or Windows, and Ubuntu is the only Linux system recorded. GitTree's source Git floor is 2.39.0.
GitTree asks you to sign in; the Free plan then covers every step here. No provider account, Pro/trial, API credential or internet service is needed. A local bare origin is not GitLab or CI. All identities use example.com; never run this lesson inside a source checkout.
Make mutations through either GitTree or the native path at identical inputs, not both consecutively. Read-only verification can follow either. Any preparation described as terminal work is labeled native preparation, never an invented app feature.
Concept and state effects
File history lists commits selected by path/history rules; blame attributes current lines to the commits that last introduced them under the selected options. Neither is a complete social explanation of who designed a feature.
Author and committer can differ. This fixture deliberately uses the same fictional Maya identity for both in her commit, and Leo for both in his. Names/emails are metadata, not proof of ownership or trusted code.
Ignoring whitespace and following moved lines can change attribution answers without changing file bytes or history. Step back from a selected blamed commit to inspect its predecessor; selection is not checkout.
The explicit README commit advances main only. Subsequent History/Blame selections and toggles change app view state; no index, working, local branch or server mutation occurs.
Prepare the exact project state
On original main save complete README_MAYA below. Native preparation uses git -c user.name/user.email only for this one commit, not global config or a misleading author-only override. Capture the actual resulting metadata.
Complete file inputs
Save only at the phase named below. These are full UTF-8/LF bodies with a final newline; never paste Markdown fences. Unchanged runnable files inherit the named input. Versions in separate variants must not overwrite the original.
README.md — README_MAYA
# GitTree Features
A fictional landing page used to learn Git and GitTree.
All people and addresses in this repository are fictional.
No form submits information to a server.
Review changes deliberately and preserve useful work.In GitTree
Palette: Command+Shift+P (Ctrl+Shift+P on Ubuntu); type the exact named command and select it. Named-ref actions use that row's context menu, not an argument-free palette shortcut.
- Show Files; open README.md and save full README_MAYA. Review the added review line.
- Commit the addition natively with the explicit fictional identity below; label this teammate preparation. Do not claim the app rewrote existing authors.
- With README.md open via Show Files and then README.md, the file view has four tabs: File, Changes, Blame and History. Choose History: it lists only this file's commits, Maya's on top. Select Maya's commit.
- Inspect the path diff and metadata; use the history list ArrowUp/ArrowDown to inspect another revision without checkout.
- Choose Blame on README.md. The header reads “Blame @” a short commit id, and the lines are grouped by commit; click the added line. Expect Maya's actual subject and identity, not an invented fixed SHA.
- Open index.html and choose Blame; inspect the footer line's Leo attribution independently.
- Ignore whitespace changes and Follow moved lines are display options of the blame view. Click a commit's group, choose Blame before this commit to see the blame as it was, then Back to the later blame.
- Back to Graph; Jump to HEAD (Ctrl+Shift+H on Ubuntu). Verify clean original main and unchanged actual tip after inspection.
For every ordinary commit: Summary is the stated subject; Description empty; Amend Previous Commit, Skip Hooks, Add Signed-off-by, Different Author, Push After Commit and Allow Empty Commit off; no co-authors. Stage only the named files, then Commit Changes to N Files once (File for one), or Command+Enter as an alternative. Wait for the real result. A lesson that explicitly amends changes only that stated option.
In the terminal
After saving README_MAYA:
git add -- README.md
git -c user.name="Maya Chen" -c user.email=maya@example.com commit --quiet -m "docs: explain deliberate review"
git log -1 --format='%an <%ae>%n%cn <%ce>' -- README.md
git blame --line-porcelain -- README.md
git blame --line-porcelain -- index.html
git status --shortThe commit succeeds. Actual author query includes:
Maya Chen <maya@example.com>
Maya Chen <maya@example.com>Complete blame output includes actual variable SHAs/times and per-line records. For the new README line the verified record fields include author Maya Chen, author-mail <maya@example.com>, summary docs: explain deliberate review, then a tab-prefixed Review changes deliberately and preserve useful work. The footer record identifies Leo Okafor and his reminder commit; this must be measured from the actual tree, not invented as a uniform author for every HTML line. Final status is empty.
Read-only alternatives:
git log --follow --format='%s' -- README.md
git blame -w -- README.md
git blame -M -- README.mdThese options answer different attribution questions; output layout is Git-version-specific and is captured, not substituted with the porcelain field excerpt.
Result
Where you end: Maya's one README addition is committed as docs: explain deliberate review on main. Blame attributes that new line to Maya and footer to Leo; inspection leaves HEAD/index/work clean and unchanged.
Common mistakes
- Calling blame a blameworthiness score.
- Assuming author always equals committer.
- Checking out a commit merely to inspect its line.
If something goes wrong
Clear view options or return to the later blame/Jump to HEAD. Navigation needs no reset. If attribution differs, inspect actual path, revision and whitespace/move settings before editing history.
Check your understanding
Answer each question, then read why. Questions marked “Required” count toward completing the lesson.
0 of 6 correct
Answer the required questions correctly to complete the lesson.
Checked in this browser.
Practice
Prove the README review line belongs to Maya and the footer to Leo using actual line-porcelain records. Toggle -w in a separate read-only query and explain why unchanged attribution here does not prove the option never matters.
Your own confirmation: the site cannot see your computer.
To complete the lesson, answer the required questions correctly and confirm the practical exercise.
Recap
- History and blame answer different questions.
- Metadata is not trust.
- Inspection does not move HEAD.
Related
Glossary terms introduced
Blame — نسب الأسطر; file history — سجل الملف; author — المؤلف; committer — المُودِع.
Video transcript
The narration of the video, cue by cue.
Show the transcript
- Start from the exact checkpoint.
- Name the branch, index and working version.
- Prepare only the isolated course copy.
- Save the complete review document.
- Record the fictional teammate identity explicitly.
- File history follows the selected path.
- Inspect metadata without checking out the commit.
- Read the added line's actual attribution.
- Check Leo's footer separately.
- View options can change attribution questions.
- Return without changing the branch.
- Blame answers what?
- Attribution is a history query, not a social judgment.
- Which distinctions matter?
- Metadata and the queried version determine the displayed evidence.
- Select old file revision: HEAD?
- Inspection selects a view, not checkout.
- Change query to ignore whitespace: bytes?
- The option changes attribution calculation, not stored content.
- Different blame result: first check?
- Different query inputs can legitimately yield different attribution.
- What proves the outcome?
- Check line evidence and independent repository state.
- Verify the actual result, not just a message.
- Predict the changed input before acting.
- Preserve useful work before recovery.
- Prove the checkpoint before continuing.
- Keep the verified result for the next step.