I'm trying to find commits whose commit message includes both key words "x" and "y". I've tried using git log --grep="x" --grep="y"
, and while this does include all commits with X and Y, it also includes those with just X or just Y.
Is there a way to grep by two expressions and inlcude only those which match both?
You need the --all-match
flag:
git log --grep="x" --grep="y" --all-match