如果未在本地/全局/系统级别设置core.autocrlf,它仍能如何设置?
问题描述:
(在Windows git version 2.14.1.windows.1
)以下所有不打印 什么:如果未在本地/全局/系统级别设置core.autocrlf,它仍能如何设置?
git config --global core.autocrlf
git config --system core.autocrlf
git config --local core.autocrlf
但下面的打印true
git config core.autocrlf
这怎么可能呢?这个值在哪里存储?
答
如果你的Git版本至少2.8.0,运行:
git config --show-origin core.autocrlf
例如,对于我的配置,其中core.autocrlf
没有设置,所以我必须用另一个名字 - 我得到:
$ git config --show-origin alias.outgoing
file:<path>/.gitconfig log --oneline @{u}..
(git outgoing
是一个快速的方式来看看我有什么提交git push
可能推动)。
检查'$ HOME/.config/git/config'。请参阅https://www.git-scm.com/docs/git-config#FILES。 – ElpieKay
@ElpieKay我没有这样的文件,但我有'%HOME%/。gitconfig'包含它。 –
如果是这样,它应该已经由'global'打印。我不知道为什么。 – ElpieKay