Re: Bug report: GIT_CONFIG and user.email/name
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 14, 2021, 20:47 UTC
- Message-ID
- <xmqqeec0vczo.fsf@gitster.g>
- In-Reply-To
- <YO8ordiN18sNP6tA@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
> The GIT_CONFIG variable doesn't work that way. It is not a general > mechanism used by all of Git, but rather a specific feature of the > git-config program (and even there it is a historical wart; you should > use "git config --file" instead).
We both have known that, but a fresh re-read of GIT_CONFIG in "git help config" gave me a misleading impression.
ENVIRONMENT
----------- GIT_CONFIG::
Take the configuration from the given file instead of .git/config.
Using the "--global" option forces this to ~/.gitconfig. Using the
"--system" option forces this to $(prefix)/etc/gitconfig.is what we have above the GLOBAL and SYSTEM you quoted below. We should say GIT_CONFIG is only for "git config" command while the other two affects everybody, right?
Thanks.
Show 15 quoted lines
> One of these variables is probably more helpful: > > $ man git | sed -n '/GLOBAL/,/^$/p' > GIT_CONFIG_GLOBAL, GIT_CONFIG_SYSTEM > Take the configuration from the given files instead from global or > system-level configuration files. If GIT_CONFIG_SYSTEM is set, the > system config file defined at build time (usually /etc/gitconfig) > will not be read. Likewise, if GIT_CONFIG_GLOBAL is set, neither > $HOME/.gitconfig nor $XDG_CONFIG_HOME/git/config will be read. Can > be set to /dev/null to skip reading configuration files of the > respective level. > > Note that they're new in v2.32.0. > > -Peff