Skip to content

Commit b3b1862

Browse files
peffgitster
authored andcommitted
doc/git-config: clarify GIT_CONFIG environment variable
The scope and utility of the GIT_CONFIG variable was drastically reduced by dc87183 (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 <[email protected]> Reviewed-by: Taylor Blau <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4bb9eb5 commit b3b1862

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Documentation/git-config.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -341,11 +341,6 @@ can specify any filename you want.
341341
ENVIRONMENT
342342
-----------
343343

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-
349344
GIT_CONFIG_GLOBAL::
350345
GIT_CONFIG_SYSTEM::
351346
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
373368
with a common configuration but cannot depend on a configuration file,
374369
for example when writing scripts.
375370

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.
376377

377378
[[EXAMPLES]]
378379
EXAMPLES

0 commit comments

Comments
 (0)