🔀 Fix git blame Ignoring a Bulk Reformat Commit
A large whitespace-only or formatter-driven commit (running Prettier or an IDE’s reformat-on-save across an entire file) touches every line without changing any actual logic, and once that commit lands, git blame attributes every single line to it by default — burying the real, meaningful authorship history under one commit that says ‘ran the formatter’ for a file’s entire contents.
🔎 The Problem
$ git blame src/OrderService.cs
a1b2c3d4 (Ayse Yilmaz 2026-11-20) public class OrderService
a1b2c3d4 (Ayse Yilmaz 2026-11-20) {
a1b2c3d4 (Ayse Yilmaz 2026-11-20) private readonly IRepo _repo;
a1b2c3d4 (Ayse Yilmaz 2026-11-20) }
# every line attributed to the reformat commit, hiding who
# actually wrote each piece of logic and when
✅ Fix: Tell Git to Walk Past the Reformat Commit
- Add the reformat commit’s hash to a
.git-blame-ignore-revsfile at the repo root, and configuregit config blame.ignoreRevsFile .git-blame-ignore-revssogit blameautomatically walks past it to the real previous change. - For a one-off check without touching repo-wide config, run
git blame --ignore-rev <hash> path/to/filedirectly, which does the same thing for that single invocation. - Configure the same ignore-revs file in your IDE’s built-in blame/annotations view (most support reading it) so day-to-day blame-in-editor lookups get the same benefit as the command line.
A reformat commit changed how every line looks, not who actually wrote it — blame just needs to be told which commit to see through.





