Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is 'git config --get-all' looking at?

Tags:

git

I can't find any documentation describing exactly what Git configuration files are being checked when a git config --get-all command is run. Here's my output when I run it for core.autocrlf:

git config --get-all core.autocrlf

Output:

false
true
true

I'm having some phantom line feed issues. Where is that first "false" is coming from? I've read that Git is supposed to use the last one, and "true" is the setting I want. But I'm not sure if it's always using that in every scenario. Like if I'm using alternative Git UI's through Eclipse Git or through the Git GUI applications or something.

I think two places that it's being read from is:

REPO_DIR/.git/config

and

WINDOWS_USER_DIR/.gitconfig

But where's this third configuration setting coming from?

like image 978
Zip184 Avatar asked Oct 23 '25 15:10

Zip184


1 Answers

Git will check these files in the given order:

  • $(prefix)/etc/gitconfig
  • $XDG_CONFIG_HOME/git/config or $HOME/.config/git/config
  • ~/.gitconfig
  • $GIT_DIR/config

So the third value likely comes from the system-wide configuration file in /etc/gitconfig.

See the git-config man page for further details.

like image 95
Sven Marnach Avatar answered Oct 26 '25 05:10

Sven Marnach



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!