Skip to content

Commit 39ba2e8

Browse files
committed
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
2 parents 6ecb4fc + 4ad47d2 commit 39ba2e8

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
@@ -161,6 +161,23 @@ can use `--no-track` to override that behaviour. The same goes for `--color`
161161
and `--no-color`.
162162

163163

164+
Options trump configuration and environment
165+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
166+
167+
When there is a configuration variable or an environment variable
168+
that tweak the behaviour of an aspect of a Git command, and also a
169+
command line option that tweaks the same, the command line option
170+
overrides what the configuration and/or environment variable say.
171+
172+
For example, the `user.name` configuration variable is used to
173+
specify the human-readable name used by the `git commit` command to
174+
record the author and the committer name in a newly created commit.
175+
The `GIT_AUTHOR_NAME` environment variable, if set, takes precedence
176+
when deciding what author name to record. The `--author=<author>`
177+
command line option of the `git commit` command, when given, takes
178+
precedence over these two sources of information.
179+
180+
164181
Aggregating short options
165182
~~~~~~~~~~~~~~~~~~~~~~~~~
166183
Commands that support the enhanced option parser allow you to aggregate short

0 commit comments

Comments
 (0)