I'm trying to figure out what is the default value for core.autocrlf
in Git if the user doesn't change this setting.
I've looked in the docs but can't find this info. Can you please point me in the right direction?
Specifically, on a fresh Git install, would Git automatically convert Windows line endings to Unix when committing to a repo from a Windows system?
Thanks!
the default value is "false" Windows installer let you choose the desired behavior but by default (if you install without changing proposed settings) it sets it to "true".
Whereas Windows follows the original convention of a carriage return plus a line feed ( CRLF ) for line endings, operating systems like Linux and Mac use only the line feed ( LF ) character. The history of these two control characters dates back to the era of the typewriter.
eol = native The default. When Git needs to change line endings to write a file in your working directory it will change them to whatever is the default line ending on your platform. For Windows this will be CRLF , for Unix/Linux/OS X this will be LF .
Checking the git source code, core.autocrlf is set to false by default. (And has been since the property's original introduction on Feb 13, 2007, though it has since been converted from a static value to a constant.)
The Windows installer does require you to pick a value for this property which is explicitly set in the git system config.
It is difficult to find this stated but I could figure out by trial and error that:
the default value is "false"
Windows installer let you choose the desired behavior but by default (if you install without changing proposed settings) it sets it to "true". This is not the software default, the installer sets the core.autocrlf system setting.
"false" means no processing on line endings "true" means checking in as LF and checking out according to system (CRLF on Windows and LF on Unix).
When Unix and Windows are both used it is advisable to use "false" on Unix (because automatic conversion can break some binary files that looks like text files and Unix uses LF anyway) and "true" on Windows (otherwise the repository is filled with CRLF which is causing compatibility issues).
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