Git blame
Git - Quick Reference
1 min read
This section is 1 min read, full guide is 16 min read
Published Jun 19 2025
7
Show sections list
0
Log in to enable the "Like" button
0
Guide comments
0
Log in to enable the "Save" button
Respond to this guide
Guide Sections
Guide Comments
CLIGit
Show which commit last modified each line of a file:
git blame filename
Copy to Clipboard
This shows on each line of the file:
- Commit hash that changed it.
- Who changed it.
- Date and time of the change.
- The line content.
Useful for finding out who introduced a bug.
Show only specific lines of a file:
git blame -L 15,30 filename
Copy to Clipboard
Shows just line 15-30 of the file.
Include the author email address as well as the name:
git blame -e filename
Copy to Clipboard
Ignore white space changes:
git blame -w filename
Copy to Clipboard
Once you have a commit hash from git blame
, you can view the full commit with:
git show <commit-hash>
Copy to Clipboard