How to grep the git diff?
Solution 1:
Not sure but isn't git diff -G <regex>
flag OK?
-G < regex>
Look for differences whose added or removed line matches the given <regex>.
Solution 2:
Have you tried git diff -S<string>
or git diff -G".*string.*"
? Note that they are not equivalent, see the documentation about pickaxe for what -S does.