Reputation: 191
I tried to use
git log --grep -e "foo|bar"
but I just got a fatal error.
Upvotes: 19
Views: 4292
Reputation: 106365
As mentioned in the docs, it's possible to use several --grep=[pattern]
options to extend search for multiple words/patterns. For example, this line:
git log --grep="foo" --grep="bar"
... finds the commits with messages including either foo
or bar
.
If you need to match only those containing both foo
and bar
instead, use --all-match
option as well:
git log --grep="foo" --grep="bar" --all-match
Upvotes: 26