๐Ÿ” History

How to use git blame

Find out who last changed each line of a file and when.

Blame a file
git blame filename.txt

Shows each line with the commit hash, author and date that last modified it.

Blame a specific line range
git blame -L 10,25 filename.txt

Shows blame only for lines 10 through 25.

When to use: Investigating a specific section of a large file.

Blame ignoring whitespace
git blame -w filename.txt

Ignores commits that only changed whitespace.

When to use: When formatting commits obscure the real author.

โ† Back to Git Reference