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-revsfile with commit hashes to ignore
- Configure git to use it:
git config blame.ignoreRevsFile .git-blame-ignore-revsBonus: Enable ”?” icon for skipped revisions:
git config blame.markIgnoredLines trueThis 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!