Excluding commits from git blame
Git Blame Ignore Feature
TL;DR: You can exclude specific commits from git blame using:
git blame --ignore-rev <rev-id> <file>
For permanent configuration:
- Create
.git-blame-ignore-revs
file with commit hashes to ignore - Configure git to use it:
git config blame.ignoreRevsFile .git-blame-ignore-revs
Bonus: Enable ”?” icon for skipped revisions:
git config blame.markIgnoredLines true
This is super useful for:
- Reformatting (tabs to spaces)
- Code style fixes
- Whitespace changes
- Spelling corrections
- Any mass changes that aren’t actual code changes
Works in IntelliJ IDEs when properly configured!