Windows ends lines with carriage-return and linefeed
CRLF
. Mac and Linux use only a linefeed
LF
. Enter
git config core.autocrlf
to the rescue!
View it
git config --get core.autocrlf
Set it
git config --global core.autocrlf=input
This is what the three alternatives do.
true
-
git checkoutconvertsLFtoCRLF -
git addconvertsCRLFtoLF
input
-
git checkoutconverts neither -
git addconvertsCRLFtoLF
false
-
git checkoutconverts neither -
git addconverts neither - reserve this setting for Windows-only projects
See also https://www.git-scm.com/book/en/v2/Customizing-Git-Git-Configuration#_formatting_and_whitespace