Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

16
  • 1
    No, of course not, once the setting is there, it will silently convert upon commit. If everything works the way I think it does, that is …
    – nes1983
    Commented Dec 11, 2009 at 18:04
  • 2
    The problem is that I already have some files in the repository that have CRLF endings and others that doesn't. I suspect that Adobe Flash adds CRLF even though I'm using the Mac version. I need to compare against older revisions of these files. Converting line endings starting from now on does not solve the problem with older revisions :-/
    – neoneye
    Commented Dec 11, 2009 at 18:14
  • 87
    You're not working with CRLF files here, at least not in the example you posted. That's an old-style mac file (just uses \r for EOL). That's why the diff is being shown on one line. A file using dos EOL would show each line distinctly with a trailing ^M, which you could tell get to handle via git config core.whitespace cr-at-eol.
    – jamessan
    Commented Dec 11, 2009 at 19:02
  • 12
    I'm trying this, but I keep getting warning: LF will be replaced by CRLF instead of warning: CRLF will be replaced by LF, and I'm in Linux. Any idea why? I want all to end with LF, not CRLF!
    – trusktr
    Commented Feb 23, 2014 at 1:00
  • 7
    @trusktr, it happened the same to me. In linux, with accidental CRLF, use git config --global core.autocrlf input, do the steps in this answer(rm, add, commit), and you will get warning: CRLF will be replaced by LF. The file will have its original line endings in your working directory.. Remove the files (because they have the original, wrong CRLF) and checkout them again from the last "Fix CRLF" commit.
    – jmmut
    Commented Oct 25, 2015 at 23:28