5

How can I find/list the global and the users config files? I mean "Git-native functionality", not Linux commandos like find.

ΩmegaMan
  • 29,542
  • 12
  • 100
  • 122
automatix
  • 14,018
  • 26
  • 105
  • 230

1 Answers1

8

In this question a comment indicated how to know which file is related to --system, --global and --local.

In short you just use --edit to git config:

git config --system --edit
git config --global --edit
git config --local --edit

If you replace the environment-variable EDITOR with e.g. echo you can receive it in a variable, ie. you can use it programmatically:

t=`EDITOR=echo git config --system --edit`
echo $t

prints /etc/gitconfig in my case.

Community
  • 1
  • 1
Patrick B.
  • 11,773
  • 8
  • 58
  • 101