summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2021-08-02 14:06:39 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-08-02 14:06:40 -0700
commit5a9b455146a9b8ee16cc6aef0b33864ea502e7a9 (patch)
tree2d4dc9a630f43f0701116d8cceae18dbe4899a62 /Documentation
parentMerge branch 'pb/submodule-recurse-doc' (diff)
parentdoc/git-config: simplify "override" advice for FILES section (diff)
downloadtgif-5a9b455146a9b8ee16cc6aef0b33864ea502e7a9.tar.xz
Merge branch 'jk/config-env-doc'
Documentation around GIT_CONFIG has been updated. * jk/config-env-doc: doc/git-config: simplify "override" advice for FILES section doc/git-config: clarify GIT_CONFIG environment variable doc/git-config: explain --file instead of referring to GIT_CONFIG
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/git-config.txt28
1 files changed, 17 insertions, 11 deletions
diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt
index 5cddadafd2..2dc4bae6da 100644
--- a/Documentation/git-config.txt
+++ b/Documentation/git-config.txt
@@ -71,6 +71,7 @@ codes are:
On success, the command returns the exit code 0.
+[[OPTIONS]]
OPTIONS
-------
@@ -143,7 +144,13 @@ See also <<FILES>>.
-f config-file::
--file config-file::
- Use the given config file instead of the one specified by GIT_CONFIG.
+ For writing options: write to the specified file rather than the
+ repository `.git/config`.
++
+For reading options: read only from the specified file rather than from all
+available files.
++
+See also <<FILES>>.
--blob blob::
Similar to `--file` but use the given blob instead of a file. E.g.
@@ -325,21 +332,14 @@ All writing options will per default write to the repository specific
configuration file. Note that this also affects options like `--replace-all`
and `--unset`. *'git config' will only ever change one file at a time*.
-You can override these rules either by command-line options or by environment
-variables. The `--global`, `--system` and `--worktree` options will limit
-the file used to the global, system-wide or per-worktree file respectively.
-The `GIT_CONFIG` environment variable has a similar effect, but you
-can specify any filename you want.
+You can override these rules using the `--global`, `--system`,
+`--local`, `--worktree`, and `--file` command-line options; see
+<<OPTIONS>> above.
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
@@ -367,6 +367,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