Skip to content

Commit 2a67e13

Browse files
jieyouxuNoratrieb
authored andcommitted
Describe .git-blame-ignore-rev
1 parent fc02fea commit 2a67e13

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/git.md

+13
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,19 @@ $ git submodule foreach git reset --hard
597597

598598
and then try `git submodule update` again.
599599

600+
## Ignoring commits during `git blame`
601+
602+
Some commits contain large reformatting changes that don't otherwise change functionality. They can
603+
be instructed to be ignored by `git blame` through
604+
[`.git-blame-ignore-revs`](https://github.com/rust-lang/rust/blob/master/.git-blame-ignore-revs):
605+
606+
1. Configure `git blame` to use `.git-blame-ignore-revs` as the list of commits to ignore: `git
607+
config blame.ignorerevsfile .git-blame-ignore-revs`
608+
2. Add suitable commits that you wish to be ignored by `git blame`.
609+
610+
Please include a comment for the commit that you add to `.git-blame-ignore-revs` so people can
611+
easily figure out *why* a commit is ignored.
612+
600613
[Git submodules]: https://git-scm.com/book/en/v2/Git-Tools-Submodules
601614
[`rust-lang/llvm-project`]: https://github.com/rust-lang/llvm-project
602615
[llvm-update]: https://github.com/rust-lang/rust/pull/99464/files

0 commit comments

Comments
 (0)