doc/git-config: clarify GIT_CONFIG environment variable

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>

Jeff King committed Jul 14, 2021 at 17:38 UTC b3b186262fd982d795be79a268c90efdd8116c1b
1 file changed +6 -5
Documentation/git-config.txt
+6 -5
@@ -341,11 +341,6 @@ can specify any filename you want.
341 ENVIRONMENT
342 -----------
343
344 -GIT_CONFIG::
345 - Take the configuration from the given file instead of .git/config.
346 - Using the "--global" option forces this to ~/.gitconfig. Using the
347 - "--system" option forces this to $(prefix)/etc/gitconfig.
348 -
344 GIT_CONFIG_GLOBAL::
345 GIT_CONFIG_SYSTEM::
346 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
368 with a common configuration but cannot depend on a configuration file,
369 for example when writing scripts.
370
371 +GIT_CONFIG::
372 + If no `--file` option is provided to `git config`, use the file
373 + given by `GIT_CONFIG` as if it were provided via `--file`. This
374 + variable has no effect on other Git commands, and is mostly for
375 + historical compatibility; there is generally no reason to use it
376 + instead of the `--file` option.
377
378 [[EXAMPLES]]
379 EXAMPLES