The problem was resolved for me by installing core.whitespace in cr-at-eol
treats carriage returns at the end of a line as part of a line terminator (git -config docs)
This can be added to the configuration file for each project or global git as follows:
[core] whitespace = cr-at-eol
This solves the problem of hiding ^ M at the end of lines that were in diff, due to a change other than line. The intention is not to ignore the changes in which the only difference is the end of the line. I am in windows with core.autocrlf = true , so line end mismatch is expected.
My only caveat is that I don’t know if this will affect whether git will create genuine EOL changes that could be committed, but maybe with autocrlf = true it never will.
An alternative fix, more targeted (but slightly more hacked), is described here .
source share