Skip to content
GitTree

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.

Progress saved in this browser.

Playing loads the video from YouTube (privacy-enhanced mode).

English narration · English and Arabic captions

Open the video pageWatch on YouTube

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

Output
# 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.

  1. Show Files; open README.md and save full README_MAYA. Review the added review line.
  2. Commit the addition natively with the explicit fictional identity below; label this teammate preparation. Do not claim the app rewrote existing authors.
  3. 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.
  4. Inspect the path diff and metadata; use the history list ArrowUp/ArrowDown to inspect another revision without checkout.
  5. 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.
  6. Open index.html and choose Blame; inspect the footer line's Leo attribution independently.
  7. 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.
  8. 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:

Command · bash
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 --short

The commit succeeds. Actual author query includes:

Output
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:

Command · bash
git log --follow --format='%s' -- README.md
git blame -w -- README.md
git blame -M -- README.md

These 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.

  1. Question 1 of 6

    Blame answers what?

    Choose one answer.

  2. Question 2 of 6

    Which distinctions matter?

    Choose every answer that applies.

  3. Question 3 of 6
    Required

    Select old file revision: HEAD?

    Choose one answer.

  4. Question 4 of 6
    Required

    Change query to ignore whitespace: bytes?

    Choose one answer.

  5. Question 5 of 6

    Different blame result: first check?

    Choose one answer.

  6. Question 6 of 6
    Required

    What proves the outcome?

    Choose every answer that applies.

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.

Glossary terms introduced

Blame — نسب الأسطر; file history — سجل الملف; author — المؤلف; committer — المُودِع.

Video transcript

The narration of the video, cue by cue.

Show the transcript
  1. Start from the exact checkpoint.
  2. Name the branch, index and working version.
  3. Prepare only the isolated course copy.
  4. Save the complete review document.
  5. Record the fictional teammate identity explicitly.
  6. File history follows the selected path.
  7. Inspect metadata without checking out the commit.
  8. Read the added line's actual attribution.
  9. Check Leo's footer separately.
  10. View options can change attribution questions.
  11. Return without changing the branch.
  12. Blame answers what?
  13. Attribution is a history query, not a social judgment.
  14. Which distinctions matter?
  15. Metadata and the queried version determine the displayed evidence.
  16. Select old file revision: HEAD?
  17. Inspection selects a view, not checkout.
  18. Change query to ignore whitespace: bytes?
  19. The option changes attribution calculation, not stored content.
  20. Different blame result: first check?
  21. Different query inputs can legitimately yield different attribution.
  22. What proves the outcome?
  23. Check line evidence and independent repository state.
  24. Verify the actual result, not just a message.
  25. Predict the changed input before acting.
  26. Preserve useful work before recovery.
  27. Prove the checkpoint before continuing.
  28. Keep the verified result for the next step.