繁体   English   中英

这些配置选项从何而来?

[英]Where are these config options coming from?

我有以下关于mergetool Git配置:

C:\Users\Me\Documents\GitHub\MyProject [branch-1]> git config --list | grep mergetool
alias.mt=mergetool
mergetool.prompt=false
mergetool.keepbackup=false
mergetool.bc3.cmd="c:/program files (x86)/beyond compare 3/bcomp.exe" "$LOCAL" "$REMOTE" "$BASE" "   $MERGED"
mergetool.bc3.trustexitcode=true
mergetool.p4.cmd="c:/program files/Perforce/p4merge.exe" "$BASE" "$LOCAL" "$REMOTE" "$MERGED"
mergetool.p4.trustexitcode=false
mergetool.kdiff3.path=C:\Program Files (x86)\KDiff3\kdiff3.exe
mergetool.kdiff3.prompt=true
mergetool.kdiff3.keepbackup=false
mergetool.kdiff3.trustexitcode=false

我最担心的是mergetool.bc3mergetool.p4如何进入那里。 这些配置既不在全局gitconfig文件中,也不在本地gitconfig文件中。 除了全局和本地存储库设置之外,还有其他地方git config --list获取配置数据吗?

编辑:我正在使用Windows

git查找至少另一个文件,即系统级配置。 我不确定在Windows上会在哪里,但是您可以使用git config -e --system对其进行编辑,而git将在编辑器中打开文件。 同样,要查找用户和本地用户,可以分别使用git config -e --globalgit config -e

git help configFILES部分

$ GIT_DIR / config存储库特定的配置文件。

〜/ .gitconfig用户特定的配置文件。 也称为“全局”配置文件。

$ XDG_CONFIG_HOME / git / config第二个用户特定的配置文件。 如果$ XDG_CONFIG_HOME未设置或为空,则将使用$ HOME / .config / git / config。 此文件中设置的任何单值变量都将被〜/ .gitconfig中的内容覆盖。 如果您有时使用旧版本的Git,最好不要创建此文件,因为该文件的支持是最近才添加的。

$(prefix)/ etc / gitconfig系统范围的配置文件。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM