I want git diff
to not show BOM changes.
Such changes typically show up as <feff>
in the diff:
-<feff>/*^M
+/*^M
How can I make git diff
to behave this way?
Preferably with a command-line parameter.
git --ignore-all-space
(aka git -w
) does not do the trick.
I am on Mac OS X if that matters.
Use Git Attributes filter
One possible solution would be to create a BOM filter such as:
store it somewhere in your path (as i.e.
removebom
) and make it executable.Then you need to configure the filter in Git by running:
and adding an attribute for files you are interested in (i.e. cpp) to your repository:
as a
.gitattributes
file.More on the topic can be found on:
Or remove the BOM once for all
... because, hopefully, the BOM may be removed once and for all in your project :)