Filtered Git Log
View git history with configurable filters to exclude automated commits, bots, and noise.
Features
- Configurable Filters: Define patterns to exclude or include commits by message or author
- Nested Filter Groups: Create complex boolean expressions with AND/OR operators
- NOT Condition: Invert any filter or group
- Folder Filter: Show commits only affecting a specific folder
- Click to Open: Click commit messages to open them in your browser (Azure DevOps, GitHub)
- Copy Hash: Click the commit hash to copy it to clipboard
- Refresh: Reload commits without reopening the panel
Usage
- Open Command Palette (
Ctrl+Shift+P)
- Run "Git: Show Filtered Log"
Configuration
Add filters to your workspace settings (.vscode/settings.json):
Simple Example - Exclude Bot Commits
{
"filteredGitLog.filters": {
"operator": "or",
"not": true,
"rules": [
{ "field": "author", "pattern": "^dependabot" },
{ "field": "author", "pattern": "^renovate" },
{ "field": "message", "pattern": "^\\[bot\\]" },
{ "field": "message", "pattern": "^Merge pull request" }
]
},
"filteredGitLog.maxCommits": 100
}
This reads as: NOT (author matches dependabot OR renovate OR message starts with [bot] OR Merge pull request)
Filter Structure
{
"operator": "and" | "or", // How to combine rules
"not": true | false, // Invert the group result
"rules": [
// Leaf rules (field + pattern)
{ "field": "message", "pattern": "regex", "not": false },
// Nested groups
{ "operator": "and", "not": false, "rules": [...] }
]
}
Leaf Rule Options
| Property |
Type |
Description |
field |
"message" or "author" |
The commit field to match |
pattern |
string |
Regex pattern (case-insensitive) |
not |
boolean |
Invert this rule's match |
Complex Example - Show Only Feature Commits from Specific Authors
{
"filteredGitLog.filters": {
"operator": "and",
"rules": [
{
"operator": "or",
"rules": [
{ "field": "author", "pattern": "Alice" },
{ "field": "author", "pattern": "Bob" }
]
},
{
"operator": "or",
"rules": [
{ "field": "message", "pattern": "^feat:" },
{ "field": "message", "pattern": "^feature:" }
]
}
]
}
}
This reads as: (author=Alice OR author=Bob) AND (message starts with feat: OR feature:)
More Examples
Exclude dependabot and merge commits:
{ "operator": "or", "not": true, "rules": [
{ "field": "author", "pattern": "dependabot" },
{ "field": "message", "pattern": "^Merge" }
]}
Show only commits with "fix" in message:
{ "rules": [{ "field": "message", "pattern": "fix" }] }
Exclude everything except a specific author:
{ "rules": [{ "field": "author", "pattern": "^MyName$", "not": true }], "not": true }
- Azure DevOps - Click to open commits in web
- GitHub - Click to open commits in web
Author
Anand Bheemarajaiah
License
MIT