Borrowed from MYYN, these are three places where you can find configuration files:
- $ GIT_DIR / configuration
- ~ / .gitconfig (- global)
- $ (prefix) / etc. / gitconfig
Well, imagine that you globally set your email address to niko.schwarz@gmail.com. Now we are creating a new repo:
$ cd /tmp $ mkdir try && cd try $ git init $ git config user.email niko.schwarz@s-i.ch $ touch hi $ git -add . $ git commit -m 'bla'
Then your user.email will be set to two values:
$ git config --list | grep niko.schwarz user.email=niko.schwarz@gmail.com user.email=niko.schwarz@s-i.ch
But if you look at the journal, the email address will be set to the one that relates to the repo:
$ git log | grep niko.schwarz Author: Niko Schwarz < niko.schwarz@s-i.ch > Signed-off-by: Niko Schwarz < niko.schwarz@s-i.ch >
Therefore, local bits are global; this is the order in which the values โโare listed. Now, turning over a bit, I would suggest that git config -list shows things in the order in which the latter take precedence.
nes1983
source share