Skip to content

Commit 4ad47d2

Browse files
committed
gitcli: document that command line trumps config and env
We centrally explain that "--no-whatever" is the way to countermand the "--whatever" option. Explain that a configured default and the value specified by an environment variable can be overridden by the corresponding command line option, too. Signed-off-by: Junio C Hamano <gitster@pobox.com> Acked-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 39bf06a commit 4ad47d2

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Documentation/gitcli.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,23 @@ can use `--no-track` to override that behaviour. The same goes for `--color`
152152
and `--no-color`.
153153

154154

155+
Options trump configuration and environment
156+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
157+
158+
When there is a configuration variable or an environment variable
159+
that tweak the behaviour of an aspect of a Git command, and also a
160+
command line option that tweaks the same, the command line option
161+
overrides what the configuration and/or environment variable say.
162+
163+
For example, the `user.name` configuration variable is used to
164+
specify the human-readable name used by the `git commit` command to
165+
record the author and the committer name in a newly created commit.
166+
The `GIT_AUTHOR_NAME` environment variable, if set, takes precedence
167+
when deciding what author name to record. The `--author=<author>`
168+
command line option of the `git commit` command, when given, takes
169+
precedence over these two sources of information.
170+
171+
155172
Aggregating short options
156173
~~~~~~~~~~~~~~~~~~~~~~~~~
157174
Commands that support the enhanced option parser allow you to aggregate short

0 commit comments

Comments
 (0)