How can I filter git logs for commits that don't contain a specific word?
I've looked at regexp sites, and tried some cases without success in Git Bash.
You can use git log --grep="<your string>" combined with the --invert-grep parameter to invert the search criteria (as of Git for Windows 2.6.2).
Find commits where the commit message contains the string foo:
git log --grep="foo"
Find commits where the commit message does not contain the string foo:
git log --invert-grep --grep="foo"
As mentioned by Claudiu
In general it's a pain to write a regular expression not containing a particular string. We had to do this for models of computation - you take an NFA, which is easy enough to define, and then reduce it to a regular expression. The expression for things not containing "cat" was about 80 characters long.
and you can do it in inverse, not elegant, but working way
git log ... | grep -v "someword"
PS - negation in RE is ^ prefix, it (prefix usage) may want -E (extended regexp) for git log, but defining negated word as word for regexp is just real nightmare
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