A simple but effective way is to pipe output to grep
. With grep -Ev
you can ignore lines using regular expressions.
diff --recursive a.git b.git | grep -Ev "^< .xaml.g.cs|^> .xaml.g.cs" | grep -Ev "Binary files$" | grep -v ".git/objects"
This ignores all lines with matching text. As for the regular expressions: ^
means line starts with, $
means line ends with. But at least for ^
you have to adjust it to the diff
output (where lines normally start with <
or >
).
Also note that diff
provides a flag --ignore-matching-lines=RE
but it might not work as you would expect as mentioned in this question/answer. And because it does not work as I would expect I rather use grep
for filtering.