git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git diff: meaning of ^M at line ends ?

From
Torsten Bögershausen <tboegi@web.de>
Date
May 14, 2018, 18:13 UTC
Message-ID
<8d7e4807-9a79-e357-8265-95f22ab716e0@web.de>
In-Reply-To
<6c23ed9e-4a14-12e4-20ca-3ac6f80cf9ec@googlemail.com>
On 14.05.18 18:08, Frank Schäfer wrote:
Show 5 quoted lines
> What does ^M at the end of lines in the output of 'git diff' mean ?
> 
> Thanks,
> Frank
> 

^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.

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)
Previous: Frank SchäferNext: Frank Schäfer
Message 2 of 4 in “git diff: meaning of ^M at line ends ?”
  1. Frank SchäferMay 14, 2018
  2. Torsten BögershausenMay 14, 2018
  3. Frank SchäferMay 15, 2018
  4. Torsten BögershausenMay 18, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.