Multiple git configurations
suggest changeGit reads configuration from several sources. A value in a later source overrides the same key from an earlier one:
%ALLUSERSPROFILE%\Git\Config(Windows only)- system file
<git>/etc/gitconfig, where<git>is the installation path (on Windows,<git>\mingw64\etc\gitconfig) $XDG_CONFIG_HOME/git/config(Linux and macOS)- global
~/.gitconfig(on Windows,%USERPROFILE%\.gitconfig) - local
.git/config(the repository’s$GIT_DIR) - a file passed to
git config -f, for examplegit config -f .gitmodules ... - the command line:
git -c core.autocrlf=false fetchsetscore.autocrlftofalsefor thatfetchonly
git config --system, git config --global, and git config --local each list one of those files. git config --list lists the resolved values.
Since Git 2.8, this also shows which file each value came from:
git config --list --show-origin
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents