git config在哪里--get-all在看 [英] Where is git config --get-all looking at

查看:944
本文介绍了git config在哪里--get-all在看的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找不到任何文档来确切描述正在运行git config --get-all command的git配置文件.这是我为core.autocrlf运行它时的输出.

I can't find any documentation describing exactly what git configuration files are being checked a git config --get-all command is run. Here's my output when I run it for core.autocrlf.

git config --get-all core.autocrlf
false
true
true

我遇到了幻影换行问题,我想知道是否有人可以告诉我第一个假"消息在哪里.我读过git应该使用最后一个,而"true"是我想要的设置.但是我不确定在每种情况下是否总是使用它.就像我通过eclipse git或git GUI应用程序之类使用替代git UI一样.

I'm having some phantom line feed issues and I was wondering if anybody can tell me where that first "false" is coming. I've read that git is supposed to use the last one, and "true" is the setting I want. But I'm not sure if it's always using that in every scenario. Like if I'm using alternative git UI's through eclipse git or through the git GUI applications or something.

我认为正在读取的两个地方是

I think two places that it's being read from is

REPO_DIR/.git/config 和 WINDOWS_USER_DIR/.gitconfig

REPO_DIR/.git/config and WINDOWS_USER_DIR/.gitconfig

但这第三个配置设置来自哪里?

But where's this 3rd config setting coming from?

推荐答案

Git将按照给定的顺序检查这些文件:

Git will check these files in the given order:

  • $(prefix)/etc/gitconfig
  • $XDG_CONFIG_HOME/git/config$HOME/.config/git/config
  • ~/.gitconfig
  • $GIT_DIR/config
  • $(prefix)/etc/gitconfig
  • $XDG_CONFIG_HOME/git/config or $HOME/.config/git/config
  • ~/.gitconfig
  • $GIT_DIR/config

因此,第三个值可能来自/etc/gitconfig中的系统范围的配置文件.

So the third value likely comes from the system-wide configuration file in /etc/gitconfig.

请参见 git-config手册页以获得更多详细信息.

See the git-config man page for further details.

这篇关于git config在哪里--get-all在看的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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