I understand that Windows uses CRLF and that it's good practice to let Git change line endings to LF before committing and back to CRLF when checking out. For that reason, I have core.autocrlf
set to true. However, contrary to what other threads say (e.g., this), I am still getting this warning:
warning: LF will be replaced by CRLF in [FILE_NAME].
The file will have its original line endings in your working directory.
Firstly, I thought setting core.autocrlf
to true was supposed to stop these warnings. Secondly, isn't Git supposed to convert LF to CRLF when committing, not the other way around?
Interestingly, I just committed many files and got this warning for only two of them (a .csproj and a .cs).
P.S. I am using Git Bash on Windows.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…