What is the priority regarding git configuration?

djangofan picture djangofan · Nov 9, 2014 · Viewed 16.2k times · Source

If I set configuration on my ~/.gitconfig file, which config would override it?

  • project level config : .git/config
  • system level config : /etc/gitconfig

Answer

Michael Kohl picture Michael Kohl · Nov 9, 2014

Lowest to highest priority:

  • /etc/gitconfig: system wide, edited when --system parameter is used
  • ~/.gitconfig: user specific configuration, edited when --global parameter is used
  • .git/config: repository specific configuration