git config显示了2个具有相同名称的属性 - 后者是否覆盖了前者?

时间:2016-10-20 15:02:06

标签: git smartgit

我遇到了SmartGit vs命令行git的一些性能问题,所以我认为这可能是由于不同的git配置。当我列出我的git配置时,我惊讶地看到一些配置值重复:

$ git config -l
core.symlinks=false
core.autocrlf=true
core.fscache=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
help.format=html
http.sslcainfo=C:/dev/tools/Git/mingw64/ssl/certs/ca-bundle.crt
diff.astextplain.textconv=astextplain
rebase.autosquash=true
credential.helper=manager
core.autocrlf=false
user.name=Eric Benzacar
user.email=eric.b@ama.org
http.sslverify=false
gc.autodetach=false

在此列表中,我看到core.autocrlf列出两次 - 一次在第2行,一次在第13行。

我故意在我的git全局配置中设置core.autocrlf=false,而我的.git文件夹中没有任何内容(事实上,我从我的根目录运行git config -l以查看上述内容列表)。

$ git config --global -l
core.autocrlf=false
user.name=Eric B
user.email=eric.b@ama.org
http.sslverify=false
gc.autodetach=false

我怀疑core.autocrlf=true是git默认值,虽然我在git docs(https://git-scm.com/book/tr/v2/Customizing-Git-Git-Configuration)中找不到任何表明情况属实的内容。此外,我对两条线都感到困惑。后者是否会超越前者?为什么Git会显示两个配置选项?

0 个答案:

没有答案