Who Changed This Line?
Git blame.
You find a strange line of code, and wonder, who wrote this, and why? Git blame shows, for every line in a file, the last commit that changed it.

- A strange line of code
- Who wrote it? Why?
- git blame
git blame
Git blame, and the file name. Each line shows the short hash, the author, the date, and then the line itself. The display none line came from commit five a nine a, and so on. Let's look at it with git show. The message says tidy styles. Now we know when it arrived, who to ask, and why.
git blame --date=short style.css ef9c9471 (Sam Lee 2026-01-05 1) body { font-family: sans-serif; } bed2a1ab (Sam Lee 2026-01-05 2) p { line-height: 1.5; } 3c99ef26 (Sam Lee 2026-01-05 3) a { color: teal; } 5a9a3544 (Sam Lee 2026-01-05 4) body { display: none; } git show --stat 5a9a354 commit 5a9a3544a95b4dbe964d6c3ed106972a1fd0cdcf Author: Sam Lee <sam@example.com> Date: Mon Jan 5 09:47:57 2026 +0000 Tidy styles style.css | 1 + 1 file changed, 1 insertion(+)
Not about blaming people
Despite its name, blame isn't about blaming people. It's about context. The commit message, and the pull request it came from, usually explain why a line exists. GitHub has a blame view too, on any file page.
Summary
Git blame shows which commit last changed each line. Follow up with git show to see why. Next, finding exactly which commit broke something.
Key takeaways- git blame <file>
- One commit per line
- git show <hash> for why