除了全局,系统和本地以外,还有其他地方可以用于git配置吗? [英] Is there any other place for a git config setting other than global, system and local?

查看:340
本文介绍了除了全局,系统和本地以外,还有其他地方可以用于git配置吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是git 2.8.3.windows.1版本,并且有些疑惑, core.autocrlf 设置实际存储在哪里。在Git扩展中,它显示为未设置,但是当我查询git config时,我得到以下内容:

I'm on git version 2.8.3.windows.1 and a bit perplexed about where the core.autocrlf setting is actually being stored. In Git Extensions it shows as "not set", however I get the following when I query 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文件也没有它

The .gitconfig file also doesn't have it

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

所以我得到GitExt如何显示它为未设置,但我完全不明白 git config -l <​​/ code>是如何获取 core.autocrlf 。我似乎无法摆脱它重写它:

So I get how GitExt is showing it as "not set", but I don't understand at all how git config -l is getting the value for core.autocrlf. And I can't seem to get rid of it to re-write it:

$ 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
...

谢谢。

Thanks.

推荐答案

是的。从 Git for Windows 2.5.0开始,有一个系统范围的Windows配置区域,因此<一个href =https://github.com/libgit2/libgit2/pull/3475 =nofollow>所有的Windows客户端都可以互操作。

Yes. Beginning with Git for Windows 2.5.0, there is a system-wide Windows configuration area, so that all Windows clients can interoperate.

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

尽管有这个名字, 配置区域在Windows上不是全局的,它与Windows安装的特定Git绑定。

Despite the name, the "global" configuration area is not global on Windows, it is tied to a particular Git for Windows installation.

这篇关于除了全局,系统和本地以外,还有其他地方可以用于git配置吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆