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?
git log --help. What you want seems to be the option listed right below--grep, which is--all-match. Alternatively you can use regex in the pattern. E.g.: Looking for commits with "analysis notebook" in them I can use "analysis * notebook" and get what I want, or the two words as separate grep patterns, joined with--all-match