When you set a global configuration option for git on Windows, where does it get written to? [duplicate]

 ̄綄美尐妖づ 提交于 2019-12-18 07:44:32

问题


If you set something like this on Windows:

git config --global core.autocrlf false

Where is this global setting getting written to?


回答1:


It will write the values in a file called .gitconfig, unless you specify another name with the '--file' option

 git config --global --file myFile key value

Note: the environment variable GIT_CONFIG can also be used to specify another name for this file. --file will supersede GIT_CONFIG value.

Whatever its name, it will write it in:

  • $HOME for Unix
  • %HOMEPATH% for Windows (c:\Users\MyName by default)

If $HOME or %HOMEPATH% is not properly set, the git config command will fail.

It is used to store a per-user configuration and serves as fallback values for the repository-local '.git/config' file.




回答2:


You can check your $HOME directory for a file like .gitconfig



来源:https://stackoverflow.com/questions/1475252/when-you-set-a-global-configuration-option-for-git-on-windows-where-does-it-get

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!