I am producing a diff between two branches with a command like
git diff <branch-1> <branch-2>
Beside the actual code differences, there is a big noise because of many changes in the form
- <version>42.2.0.12</version>
+ <version>42.3.0.10</version>
I would like to see a clean diff, where those differences are either excluded or non-highlighted.
I already checked two similar SO questions, which were of no help:
- How to make git diff ignore comments: leads to a non-working solution
- How do I make git diff ignore version number changes: is better, as it ignore the 'x.y.z', but leads to a messy git diff, where I cannot really see the lines that have changed because it reports the changes on each single word.
For instance, in the second case, I used
git diff -w --word-diff-regex='[^<version>(0-9\.)</version>]' <branch-1> <branch-2>
Now that the premise is set, the question is:
- Is there a way to use git diff and just remove some unwanted differences such as
<version>x.y.z</version>
?