]> git.ipfire.org Git - thirdparty/git.git/commitdiff
doc/git-config: clarify GIT_CONFIG environment variable
authorJeff King <peff@peff.net>
Wed, 14 Jul 2021 21:38:16 +0000 (17:38 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 20 Jul 2021 21:55:06 +0000 (14:55 -0700)
The scope and utility of the GIT_CONFIG variable was drastically reduced
by dc87183189 (Only use GIT_CONFIG in "git config", not other programs,
2008-06-30). But the documentation in git-config(1) predates that, which
makes it rather misleading.

These days it is really just another way to say "--file". So let's say
that, and explicitly make it clear that it does not impact other Git
commands (like GIT_CONFIG_SYSTEM, etc, would).

I also bumped it to the bottom of the list of variables, and warned
people off of using it. We don't have any plans for deprecation at this
point, but there's little point in encouraging people to use it by
putting it at the top of the list.

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-config.txt

index 6c78ad1c1312d4bf0207490346318d044a89c818..13489574978de0971c67ba3636e26eecbb500fde 100644 (file)
@@ -341,11 +341,6 @@ can specify any filename you want.
 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.
-
 GIT_CONFIG_GLOBAL::
 GIT_CONFIG_SYSTEM::
        Take the configuration from the given files instead from global or
@@ -373,6 +368,12 @@ This is useful for cases where you want to spawn multiple git commands
 with a common configuration but cannot depend on a configuration file,
 for example when writing scripts.
 
+GIT_CONFIG::
+       If no `--file` option is provided to `git config`, use the file
+       given by `GIT_CONFIG` as if it were provided via `--file`. This
+       variable has no effect on other Git commands, and is mostly for
+       historical compatibility; there is generally no reason to use it
+       instead of the `--file` option.
 
 [[EXAMPLES]]
 EXAMPLES