Ok, so i have read all threads on this topic, and my understanding is the following:
if i set core.autocrlf = true in Windows, git should convert all my crlf line endings to LF when committing and pushing.
This is what i want, and i have my config set up as such. However, when i check in a text file with CRLF endings, i get the error messsage:
fatal: LF would be replaced by CRLF
I don't get it... shoudn't the opposite happen when i commit?
The message is misleading, but makes sense:
CRLF
is replaced with LF
, LF
is kept as LF
.LF
will be replaced with CRLF
.At the end of that process, all the LF
s in your working dir have been replaced with CRLF
. That is what git is warning you about.
Note: I would not recommend using core.autocrlf
– it is an old setting that has been superseded. Use attributes instead. See here: https://stackoverflow.com/a/13154031/758345
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With