简体   繁体   中英

Where are these config options coming from?

I have the following Git configurations regarding mergetool :

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. These configurations are not in the global gitconfig file nor are they in the local one. Is there another place where git config --list fetches configuration data other than the global and local repository settings?

EDIT: I am using Windows

git looks in at least one other file, a system level config. 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. Similarly to find user and local you can use git config -e --global and git config -e respectively.

From the FILES section of git help config

$GIT_DIR/config Repository specific configuration file.

~/.gitconfig User-specific configuration file. Also called "global" configuration file.

$XDG_CONFIG_HOME/git/config Second user-specific configuration file. If $XDG_CONFIG_HOME is not set or empty, $HOME/.config/git/config will be used. Any single-valued variable set in this file will be overwritten by whatever is in ~/.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.

$(prefix)/etc/gitconfig System-wide configuration file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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