Search Git commits by message
12 November 2025 (Updated 12 November 2025)
Syntax
git log -g --grep=<message>
Example
Search all commits across all branches (thanks to -g) where the commit message has the string bugfix:
git log -g --grep=bugfix
Tagged:
Git recipes