Searching commits¶
The search field sits above the commit graph. Click it, press Ctrl+F (Cmd+F on macOS) while the commit list has focus, or run Search commits from the command palette. Once you stop typing, the graph is replaced by the matching commits and the first match is selected. Press ↓ in the field to move into the results.
| Syntax | Meaning |
|---|---|
word |
Message contains it, or SHA starts with it |
"two words" |
Exact phrase |
author:NAME |
Author name or email |
committer:NAME |
Committer name or email |
message:TEXT |
Anywhere in the full message |
commit:SHA |
SHA starts with it |
path:PATTERN |
Changes a matching path (src/, *.md) |
contents:TEXT |
An added or removed line contains it |
after:YYYY-MM-DD |
Committed on or after that day |
before:YYYY-MM-DD |
Committed on or before that day |
branch:NAME |
Only commits reachable from NAME |
- Terms combine with AND. Case is ignored except in
path:. - Quote text with spaces or a colon (
"fix: crash"). An unquotedword:that is not one of the keys above is an error, so a conventional-commit prefix likefix:needs quotes. - Dates are whole days in the commit's own timezone, inclusive.
path:andcontents:look at what a commit changed compared with its first parent, so a merge counts as the changes it brought in.- Without
branch:, the search covers the branches the graph shows (see Which branches the graph shows). - Results load 100 at a time, and "Scanned N commits…" shows progress on large histories.
- Selecting a result shows its diff as usual.
- Esc or × goes back to the graph and the previous selection.
- File history opened from a result returns to the results when closed.