Describe `.git-blame-ignore-rev`

This commit is contained in:
许杰友 Jieyou Xu (Joe) 2024-09-23 16:40:39 +08:00 committed by nora
parent fc02fead52
commit 2a67e1351a
1 changed files with 13 additions and 0 deletions

View File

@ -597,6 +597,19 @@ $ git submodule foreach git reset --hard
and then try `git submodule update` again. and then try `git submodule update` again.
## Ignoring commits during `git blame`
Some commits contain large reformatting changes that don't otherwise change functionality. They can
be instructed to be ignored by `git blame` through
[`.git-blame-ignore-revs`](https://github.com/rust-lang/rust/blob/master/.git-blame-ignore-revs):
1. Configure `git blame` to use `.git-blame-ignore-revs` as the list of commits to ignore: `git
config blame.ignorerevsfile .git-blame-ignore-revs`
2. Add suitable commits that you wish to be ignored by `git blame`.
Please include a comment for the commit that you add to `.git-blame-ignore-revs` so people can
easily figure out *why* a commit is ignored.
[Git submodules]: https://git-scm.com/book/en/v2/Git-Tools-Submodules [Git submodules]: https://git-scm.com/book/en/v2/Git-Tools-Submodules
[`rust-lang/llvm-project`]: https://github.com/rust-lang/llvm-project [`rust-lang/llvm-project`]: https://github.com/rust-lang/llvm-project
[llvm-update]: https://github.com/rust-lang/rust/pull/99464/files [llvm-update]: https://github.com/rust-lang/rust/pull/99464/files