简体   繁体   English

这些配置选项从何而来?

[英]Where are these config options coming from?

I have the following Git configurations regarding mergetool : 我有以下关于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

I am most concerned about how mergetool.bc3 and mergetool.p4 got in there. 我最担心的是mergetool.bc3mergetool.p4如何进入那里。 These configurations are not in the global gitconfig file nor are they in the local one. 这些配置既不在全局gitconfig文件中,也不在本地gitconfig文件中。 Is there another place where git config --list fetches configuration data other than the global and local repository settings? 除了全局和本地存储库设置之外,还有其他地方git config --list获取配置数据吗?

EDIT: I am using Windows 编辑:我正在使用Windows

git looks in at least one other file, a system level config. git查找至少另一个文件,即系统级配置。 I'm not sure where that would be on Windows but you could edit it with git config -e --system and git will open the file in your editor. 我不确定在Windows上会在哪里,但是您可以使用git config -e --system对其进行编辑,而git将在编辑器中打开文件。 Similarly to find user and local you can use git config -e --global and git config -e respectively. 同样,要查找用户和本地用户,可以分别使用git config -e --globalgit config -e

From the FILES section of git help config git help configFILES部分

$GIT_DIR/config Repository specific configuration file. $ GIT_DIR / config存储库特定的配置文件。

~/.gitconfig User-specific configuration file. 〜/ .gitconfig用户特定的配置文件。 Also called "global" configuration file. 也称为“全局”配置文件。

$XDG_CONFIG_HOME/git/config Second user-specific configuration file. $ XDG_CONFIG_HOME / git / config第二个用户特定的配置文件。 If $XDG_CONFIG_HOME is not set or empty, $HOME/.config/git/config will be used. 如果$ XDG_CONFIG_HOME未设置或为空,则将使用$ HOME / .config / git / config。 Any single-valued variable set in this file will be overwritten by whatever is in ~/.gitconfig. 此文件中设置的任何单值变量都将被〜/ .gitconfig中的内容覆盖。 It is a good idea not to create this file if you sometimes use older versions of Git, as support for this file was added fairly recently. 如果您有时使用旧版本的Git,最好不要创建此文件,因为该文件的支持是最近才添加的。

$(prefix)/etc/gitconfig System-wide configuration file. $(prefix)/ etc / gitconfig系统范围的配置文件。

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

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