Git-diff 有一个选项 -G
,它使用正则表达式来匹配差异。
如何反其道而行之? IE。查找添加或删除的行与给定正则表达式不匹配的差异?
最佳答案
我不认为您可以使用正则表达式来实现这一点。解决方法是:
diff <(git diff) <(git diff -G <regex>)
关于Git 差异 : how to do the opposite of -G<regex>?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20426770/