aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-01-23 15:07:02 -0800
committerJunio C Hamano <gitster@pobox.com>2025-01-23 15:07:02 -0800
commit39ba2e8e5627a8a3062d257928824139ca71c5f3 (patch)
treed8255c2906df00824542db3b37fc95183b0cdc4b
parentMerge branch 'mh/doc-credential-helpers-with-pat' (diff)
parentgitcli: document that command line trumps config and env (diff)
downloadgit-39ba2e8e5627a8a3062d257928824139ca71c5f3.tar.gz
git-39ba2e8e5627a8a3062d257928824139ca71c5f3.zip
Merge branch 'jc/cli-doc-option-and-config'
Doc update. * jc/cli-doc-option-and-config: gitcli: document that command line trumps config and env
-rw-r--r--Documentation/gitcli.txt17
1 files changed, 17 insertions, 0 deletions
diff --git a/Documentation/gitcli.txt b/Documentation/gitcli.txt
index fcd86d2eee..04193ec907 100644
--- a/Documentation/gitcli.txt
+++ b/Documentation/gitcli.txt
@@ -161,6 +161,23 @@ can use `--no-track` to override that behaviour. The same goes for `--color`
and `--no-color`.
+Options trump configuration and environment
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+When there is a configuration variable or an environment variable
+that tweak the behaviour of an aspect of a Git command, and also a
+command line option that tweaks the same, the command line option
+overrides what the configuration and/or environment variable say.
+
+For example, the `user.name` configuration variable is used to
+specify the human-readable name used by the `git commit` command to
+record the author and the committer name in a newly created commit.
+The `GIT_AUTHOR_NAME` environment variable, if set, takes precedence
+when deciding what author name to record. The `--author=<author>`
+command line option of the `git commit` command, when given, takes
+precedence over these two sources of information.
+
+
Aggregating short options
~~~~~~~~~~~~~~~~~~~~~~~~~
Commands that support the enhanced option parser allow you to aggregate short