Re: git diff: meaning of ^M at line ends ?
- From
- Frank Schäfer <fschaefer.oss@googlemail.com>
- Date
- May 15, 2018, 18:04 UTC
- Message-ID
- <ec5c536a-708a-1fd2-6ee2-98271b90b0fb@googlemail.com>
- In-Reply-To
- <8d7e4807-9a79-e357-8265-95f22ab716e0@web.de>
Am 14.05.2018 um 20:13 schrieb Torsten Bögershausen:
Show 9 quoted lines
> ^M is the representation of a "Carriage Return" or CR. > Under Linux/Unix/Mac OS X a line is terminated with a single > "line feed", LF. > > Windows typically uses CRLF at the end of the line. > "git diff" uses the LF to detect the end of line, > leaving the CR alone. > > Nothing to worry about.
Thanks, I already suspected something like that. Has this behavior been changed/added recently ? I didn't observe it before, although the project I'm currently looking into has always been using CR+LF...
Why does the ^M only show up in '+' lines ? When changing the line end from CR+LF to LF, the diff looks like this:
-blahblah +blahblah
But I would expect it to be
-blahblah^M +blahblah
Regards, Frank
Show 8 quoted lines
> If you want, you can commit those files with > CRLF in the working tree, and LF in the repo. > > More information may be found here: > > https://git-scm.com/docs/gitattributes > > (Or ask more questions here, if needed)