git blame See who last changed each line of a file

Prints a file with the commit, author and date that last touched every line. Use it to find out why a line is the way it is and who to ask.

Synopsis

git blame [OPTION]... FILE

Common options

Option or formWhat it does
-L START,ENDOnly show those line numbers
-wIgnore whitespace changes when assigning blame
-CDetect lines moved or copied from other files
-eShow the author email instead of the name
--ignore-rev COMMITSkip a commit, such as a bulk reformat

Examples

Blame a whole file
git blame src/app.js
3f2a9c1 (Ana Lopez 2026-09-02 10:14 1) const express = require("express");
Blame a range of lines
git blame -L 40,60 src/app.js
Ignore whitespace and moved lines
git blame -w -C src/app.js
Skip formatting commits using a list
git blame --ignore-revs-file .git-blame-ignore-revs src/app.js

Notes

See also

Last reviewed 2026-10-09.