Skip to content

Commit d218178

Browse files
committed
Merge pull request #1165 from asheiduk/config-docu
Align documentation for C:\ProgramData\Git\config
2 parents 1e689d1 + 95833da commit d218178

File tree

2 files changed

+9
-14
lines changed

2 files changed

+9
-14
lines changed

Documentation/git-config.txt

+8-8
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,16 @@ FILES
235235
If not set explicitly with `--file`, there are four files where
236236
'git config' will search for configuration options:
237237

238+
$PROGRAMDATA/Git/config::
239+
(Windows-only) System-wide configuration file shared with other Git
240+
implementations. Typically `$PROGRAMDATA` points to `C:\ProgramData`.
241+
238242
$(prefix)/etc/gitconfig::
239243
System-wide configuration file.
244+
(Windows-only) This file contains only the settings which are
245+
specific for this installation of Git for Windows and which should
246+
not be shared with other Git implementations like JGit, libgit2.
247+
`--system` will select this file.
240248

241249
$XDG_CONFIG_HOME/git/config::
242250
Second user-specific configuration file. If $XDG_CONFIG_HOME is not set
@@ -253,14 +261,6 @@ $XDG_CONFIG_HOME/git/config::
253261
$GIT_DIR/config::
254262
Repository specific configuration file.
255263

256-
On Windows, as there is no central `/etc/` directory, there is yet another
257-
config file (located at `$PROGRAMDATA/Git/config`), intended to contain
258-
settings for *all* Git-related software running on the machine. Consequently,
259-
this config file takes an even lower precedence than the
260-
`$(prefix)/etc/gitconfig` file. Typically `$PROGRAMDATA` points to
261-
`C:\ProgramData` (on Windows XP the equivalent in `$ALLUSERSPROFILE` is used,
262-
i.e. `C:\Documents and Settings\All Users\Application Data\Git\config`).
263-
264264
If no further options are given, all reading options will read all of these
265265
files that are available. If the global or the system-wide configuration
266266
file are not available they will be ignored. If the repository configuration

compat/mingw.c

+1-6
Original file line numberDiff line numberDiff line change
@@ -3271,13 +3271,8 @@ const char *program_data_config(void)
32713271

32723272
if (!initialized) {
32733273
const char *env = mingw_getenv("PROGRAMDATA");
3274-
const char *extra = "";
3275-
if (!env) {
3276-
env = mingw_getenv("ALLUSERSPROFILE");
3277-
extra = "/Application Data";
3278-
}
32793274
if (env)
3280-
strbuf_addf(&path, "%s%s/Git/config", env, extra);
3275+
strbuf_addf(&path, "%s/Git/config", env);
32813276
initialized = 1;
32823277
}
32833278
return *path.buf ? path.buf : NULL;

0 commit comments

Comments
 (0)