Skip to content

Instantly share code, notes, and snippets.

@kateinoigakukun
Created December 17, 2021 14:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kateinoigakukun/b0bc920e587851bfffa98b9e279175f2 to your computer and use it in GitHub Desktop.
Save kateinoigakukun/b0bc920e587851bfffa98b9e279175f2 to your computer and use it in GitHub Desktop.

Since version 2.23, git-blame has a feature to ignore certain commits. This feature is useful to ignore large formatting or apparently unimportant changes.

How to use

  1. Create a revisions list file. The file name is usually .git-blame-ignore-revs
  2. Set the file as a default ignore file for blame by git config blame.ignoreRevsFile .git-blame-ignore-revs

The file format is described in git-fsck's man: https://git-scm.com/docs/git-fsck#Documentation/git-fsck.txt-fsckskipList

e.g.

# clang-format all

db9124f1de0478dcac525009b6f1589b44a7edd8
c6378bdd46cb9fbeb4e7a0fbb37d820f8b82232d

# rename XX
1795070c67cd08f5c5437b4e0d3ae6e5d3e5fd13
...

Examples

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment