Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align documentation for C:\ProgramData\Git\config #1165

Merged
merged 2 commits into from
May 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions Documentation/git-config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,16 @@ FILES
If not set explicitly with `--file`, there are four files where
'git config' will search for configuration options:

$PROGRAMDATA/Git/config::
(Windows-only) System-wide configuration file shared with other Git
implementations. Typically `$PROGRAMDATA` points to `C:\ProgramData`.

$(prefix)/etc/gitconfig::
System-wide configuration file.
(Windows-only) This file contains only the settings which are
specific for this installation of Git for Windows and which should
not be shared with other Git implementations like JGit, libgit2.
`--system` will select this file.

$XDG_CONFIG_HOME/git/config::
Second user-specific configuration file. If $XDG_CONFIG_HOME is not set
Expand All @@ -253,14 +261,6 @@ $XDG_CONFIG_HOME/git/config::
$GIT_DIR/config::
Repository specific configuration file.

On Windows, as there is no central `/etc/` directory, there is yet another
config file (located at `$PROGRAMDATA/Git/config`), intended to contain
settings for *all* Git-related software running on the machine. Consequently,
this config file takes an even lower precedence than the
`$(prefix)/etc/gitconfig` file. Typically `$PROGRAMDATA` points to
`C:\ProgramData` (on Windows XP the equivalent in `$ALLUSERSPROFILE` is used,
i.e. `C:\Documents and Settings\All Users\Application Data\Git\config`).

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

If no further options are given, all reading options will read all of these
files that are available. If the global or the system-wide configuration
file are not available they will be ignored. If the repository configuration
Expand Down
7 changes: 1 addition & 6 deletions compat/mingw.c
Original file line number Diff line number Diff line change
Expand Up @@ -3304,13 +3304,8 @@ const char *program_data_config(void)

if (!initialized) {
const char *env = mingw_getenv("PROGRAMDATA");
const char *extra = "";
if (!env) {
env = mingw_getenv("ALLUSERSPROFILE");
extra = "/Application Data";
}

This comment was marked as off-topic.

This comment was marked as off-topic.

if (env)
strbuf_addf(&path, "%s%s/Git/config", env, extra);
strbuf_addf(&path, "%s/Git/config", env);
initialized = 1;
}
return *path.buf ? path.buf : NULL;
Expand Down