You have up to 5 sources for git configuration:
%ALLUSERSPROFILE%\Git\Config
(Windows only)<git>/etc/gitconfig
, with <git>
being the git installation path.<git>\mingw64\etc\gitconfig
)$XDG_CONFIG_HOME/git/config
(Linux/Mac only)~/.gitconfig
(Windows: %USERPROFILE%\.gitconfig
).git/config
(within a git repo $GIT_DIR
)git config -f
), used for instance to modify the config of submodules: git config -f .gitmodules ...
git -c
: git -c core.autocrlf=false fetch
would override any other core.autocrlf
to false
, just for that fetch
command.The order is important: any config set in one source can be overridden by a source listed below it.
git config --system/global/local
is the command to list 3 of those sources, but only git config -l would list all resolved configs.
"resolved" means it lists only the final overridden config value.
Since git 2.8, if you want to see which config comes from which file, you type:
git config --list --show-origin