Git diff: how to do the opposite of -G <regex>?

Git-diff has a parameter -Gthat uses a regex to match differences.

How to do the opposite? That is, to look for differences whose added or deleted lines do not match the given regular expression?

+4
source share
1 answer

I do not think that you can achieve this with regular expression. A workaround would be to say:

diff <(git diff) <(git diff -G <regex>)
+1
source

All Articles