Git core.autocrlf line ending default setting

前端 未结 5 2070
Happy的楠姐
Happy的楠姐 2020-12-30 19:05

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\

5条回答
  •  [愿得一人]
    2020-12-30 19:27

    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.

提交回复
热议问题