You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
4. To see earlier revisions of a specific line, or reblame, click {% octicon "versions" aria-label="The prior blame icon" %} until you've found the changes you're interested in viewing.
**Note:** Ignoring commits in the blame view is currently in public beta and subject to change.
59
+
60
+
{% endnote %}
61
+
62
+
All revisions specified in the `.git-blame-ignore-revs` file, which must be in the root directory of your repository, are hidden from the blame view using Git's `git blame --ignore-revs-file` configuration setting. For more information, see [`git blame --ignore-revs-file`](https://git-scm.com/docs/git-blame#Documentation/git-blame.txt---ignore-revs-fileltfilegt) in the Git documentation.
63
+
64
+
1. In the root directory of your repository, create a file named `.git-blame-ignore-revs`.
65
+
2. Add the commit hashes you want to exclude from the blame view to that file. We recommend the file to be structured as follows, including comments:
66
+
67
+
```ini
68
+
# .git-blame-ignore-revs
69
+
# Removed semi-colons from the entire codebase
70
+
a8940f7fbddf7fad9d7d50014d4e8d46baf30592
71
+
# Converted all JavaScript to TypeScript
72
+
69d029cec8337c616552756310748c4a507bd75a
73
+
```
74
+
75
+
3. Commit and push the changes.
76
+
77
+
Now when you visit the blame view, the listed revisions will not be included in the blame. You'll see an **Ignoring revisions in .git-blame-ignore-revs** banner indicating that some commits may be hidden:
78
+
79
+

80
+
81
+
This can be useful when a few commits make extensive changes to your code. You can use the file when running `git blame` locally as well:
0 commit comments