git-config(1): clarify precedence of multiple values

In order to clarify which value is used when there are multiple values defined for a key, re-order the list of file locations so that it runs from least specific to most specific. Then add a paragraph which simply says that the last value will be used. Signed-off-by: John Keeping <john@keeping.me.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>

John Keeping committed Jul 7, 2013 at 20:49 UTC 7da9800fff189b93b46bb5e8763b75101264d940
1 file changed +12 -8
Documentation/git-config.txt
+12 -8
@@ -197,12 +197,8 @@ FILES
197 If not set explicitly with '--file', there are four files where
198 'git config' will search for configuration options:
199
200 -$GIT_DIR/config::
201 - Repository specific configuration file.
202 -
203 -~/.gitconfig::
204 - User-specific configuration file. Also called "global"
205 - configuration file.
200 +$(prefix)/etc/gitconfig::
201 + System-wide configuration file.
202
203 $XDG_CONFIG_HOME/git/config::
204 Second user-specific configuration file. If $XDG_CONFIG_HOME is not set
@@ -212,8 +208,12 @@ $XDG_CONFIG_HOME/git/config::
208 you sometimes use older versions of Git, as support for this
209 file was added fairly recently.
210
215 -$(prefix)/etc/gitconfig::
216 - System-wide configuration file.
211 +~/.gitconfig::
212 + User-specific configuration file. Also called "global"
213 + configuration file.
214 +
215 +$GIT_DIR/config::
216 + Repository specific configuration file.
217
218 If no further options are given, all reading options will read all of these
219 files that are available. If the global or the system-wide configuration
@@ -221,6 +221,10 @@ file are not available they will be ignored. If the repository configuration
221 file is not available or readable, 'git config' will exit with a non-zero
222 error code. However, in neither case will an error message be issued.
223
224 +The files are read in the order given above, with last value found taking
225 +precedence over values read earlier. When multiple values are taken then all
226 +values of a key from all files will be used.
227 +
228 All writing options will per default write to the repository specific
229 configuration file. Note that this also affects options like '--replace-all'
230 and '--unset'. *'git config' will only ever change one file at a time*.