0

I am using Git under Windows to check in some files. I received warning like

LF will be replaced by CRLF in foobar

what does this warning mean? Can I do something to prevent this warning.

Adam Lee
  • 24,710
  • 51
  • 156
  • 236

3 Answers3

0

That is related to core.autocrlf option. Manual says this:

   core.autocrlf
       Setting this variable to "true" is almost the same as setting the
       text attribute to "auto" on all files except that text files are
       not guaranteed to be normalized: files that contain CRLF in the
       repository will not be touched. Use this setting if you want to
       have CRLF line endings in your working directory even though the
       repository does not have normalized line endings. This variable can
       be set to input, in which case no output conversion is performed.

Git warns you that he changed line terminators for you.

I recommend to set global policy for the project (like "always use unix line ends" or vice versa) and disable this option. Things get messy sometimes and commit diffs then contain a lot of extra whitespace changes.

Josef Kufner
  • 2,851
  • 22
  • 28
0

msysgit default system config is core.autocrlf = true, which means CRLF conversion is ON.

linquize
  • 19,828
  • 10
  • 59
  • 83
0

It probably means you tried to add a file with LF line endings, and you have core.autocrlf turned on. Convert the file to CR/LF line endings, or turn off core.autocrlf.

Also here, here, here, etc.

Community
  • 1
  • 1
ellotheth
  • 4,333
  • 2
  • 17
  • 29