How to grep the git diff?

后端 未结 9 698
耶瑟儿~
耶瑟儿~ 2021-01-31 06:55

Is there a way to show the git-diff filtered by a given pattern.

Something like

git grepdiff pattern

changed file
+++ some sentence with pattern
change         


        
9条回答
  •  暖寄归人
    2021-01-31 07:33

    Have you tried git diff -S or git diff -G".*string.*"? Note that they are not equivalent, see the documentation about pickaxe for what -S does.

提交回复
热议问题