Git Blame Ignore Revs
I've been a part of a lot of code cleanups, and touching legacy codebases. Often times I'd run prettier, or a linter or formatter across the entire codebase and change a whole lot that is not really changing the functionality, but the readability of the codebase. And I didn't like it when my name would be the last name on a git blame when I may not really know much about that part of the code, but my name is there because I ran that linter/formatter.
Well from a PR at work, today I learned that you can specify these kinds of commits, in a file in the codebase, and they'll not include that commit in a git blame command!
Apparently since 2019 this has been a thing!
Creating a .git-blame-ignore-revs
, and putting one hash per line will do the trick.
I like Micheal's post here, that recommends you put a comment as to why that commit is there too.