【问题标题】:Is there any other place for a git config setting other than global, system and local?除了全局、系统和本地之外,还有其他地方可以设置 git config 吗?
【发布时间】:2016-07-12 19:52:51
【问题描述】:

我使用的是 git 版本 2.8.3.windows.1,对 core.autocrlf 设置的实际存储位置有点困惑。在 Git Extensions 中它显示为“未设置”,但是当我查询 git config 时得到以下信息:

$ cd /c             <-- i.e. not a repo

$ git config --get core.autocrlf
false

$ git config --global --get core.autocrlf
(nothing)
$ git config --system --get core.autocrlf
(nothing)

$ git config -l
core.symlinks=false
core.autocrlf=false
core.fscache=true
...

$ git config --system -l
credential.helper=manager

$ git config --global -l
core.editor="C:/Program Files (x86)/GitExtensions/GitExtensions.exe" fileeditor
core.quotepath=false
color.ui=auto
... (not here either)

$ git config --local -l
fatal: unable to read config file '.git/config': No such file or directory

.gitconfig 文件也没有

$ cat ~/.gitconfig
[core]
        editor = \"C:/Program Files (x86)/GitExtensions/GitExtensions.exe\" fileeditor
        quotepath = false

所以我知道 GitExt 如何将其显示为“未设置”,但我完全不明白 git config -l 如何获得 core.autocrlf 的值。而且我似乎无法摆脱它来重新编写它:

$ git config --unset core.autocrlf
fatal: not in a git directory

$ git config --unset --global core.autocrlf

$ git config -l
core.symlinks=false
core.autocrlf=false
core.fscache=true
...

谢谢。

【问题讨论】:

标签: git


【解决方案1】:

是的。以Git for Windows 2.5.0开头,有一个system-wide Windows configuration area,所以all Windows clients can interoperate

这个新路径是%PROGRAMDATA%\Git\config

尽管名称如此,“全局”配置区域在 Windows 上不是全局的,它与特定的 Git for Windows 安装相关联。

【讨论】:

    猜你喜欢
    • 2012-08-28
    • 1970-01-01
    • 2018-03-01
    • 2019-09-14
    • 2017-07-18
    • 2015-12-08
    • 1970-01-01
    • 1970-01-01
    • 2022-07-25
    相关资源
    最近更新 更多