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 form | What it does |
|---|---|
-L START,END | Only show those line numbers |
-w | Ignore whitespace changes when assigning blame |
-C | Detect lines moved or copied from other files |
-e | Show the author email instead of the name |
--ignore-rev COMMIT | Skip a commit, such as a bulk reformat |
Examples
git blame src/app.js
3f2a9c1 (Ana Lopez 2026-09-02 10:14 1) const express = require("express");
git blame -L 40,60 src/app.js
git blame -w -C src/app.js
git blame --ignore-revs-file .git-blame-ignore-revs src/app.js
Notes
- Blame shows the last change, not the original author of the idea. Follow the commit with git show to see context.
- The GitHub web page for any file has a Blame button that does the same with links to each commit.
- If a name appears as ^abc123, that line came from the first commit.
See also
Last reviewed 2026-10-09.