How to Find Who Changed a Line With git blame

git blame annotates every line of a file with the commit and author that last modified it.

Published September 28, 2026

git blame annotates every line of a file with the commit and author that last modified it.

Key points

  • Useful for understanding why a specific line of code exists before changing or removing it
  • git blame -L 10,20 file.js restricts the output to a specific line range
  • A line showing an old, unrelated commit can mean the line hasn't changed since — not that it's unimportant

Example

git blame -L 10,20 src/app.js
More Git articles