Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Try putting the refactoring commit in .git-blame-ignore-revs


Note that .git-blame-ignore-revs is just a convention, git doesn't automatically use the file like how git treats the .gitignore file. You can add it to the repo configuration though, so you don't need to pass --ignore-revs-file every time, provided that you're running Git 2.3+[0].

    $ git config blame.ignoreRevsFile .git-blame-ignore-revs
This is extremely useful if, for example, your team decided to introduce new automated style changes, and didn't want to completely clobber the history for blame. By specifying the commit that introduced the style change, actual "interesting" changes should be correctly attributed and the style change commit is ignored in the blame output.

[0] https://github.com/git/git/blob/master/Documentation/RelNote...




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: