I tried to use
git log --grep -e "foo|bar"
but I just got a fatal error.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With