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\
For the purposes of OP's specific situation, and also in case of cross-platform differences, global .gitconfig file, and local .gitconfig file, the best way to determine this should be to run:
git config core.autocrlf
after the clean install of Git to find out which setting prevails.
Note that the output of the command will change depending on your current working directory (and its local .gitconfig)
NOTE:
The comment describing the same command on Unix actually does work, but poster had used the wrong config key. It should be core.autocrlf, not autocrlf.
Documentation on git-scm.com/book/en/v2/Customizing-Git-Git-Configuration lists three options but doesn't say which is default, and on my clean install on Ubuntu git config --list gives no entry for autocrlf, git config --get autocrlf returns error: key does not contain a section: autocrlf. Presumably this means default is false but it'd be good to have this confirmed.
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.
If you're using the newest window installer of git, the default option of core.autoclrf is false .
You can list all config key-values by issuing this command
git config --list
And as I see the default is
core.autocrlf=true
Although this is the setting I chose(or better to say "not touched") when I was installing Git for Windows
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).