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

Add ability to specify default settings values from the registry on Windows #404

Merged
merged 4 commits into from
Aug 10, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ See detailed information [here](https://aka.ms/gcmcore-httpproxy).
- [Command-line usage](docs/usage.md)
- [Configuration options](docs/configuration.md)
- [Environment variables](docs/environment.md)
- [Enterprise configuration](docs/enterprise-config.md)
- [Network and HTTP configuration](docs/netconfig.md)
- [Architectural overview](docs/architecture.md)
- [Host provider specification](docs/hostprovider.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Global configuration settings override system configuration settings, and local
GCM Core honors several levels of settings, in addition to the standard local \> global \> system tiering Git uses.
URL-specific settings or overrides can be applied to any value in the `credential` namespace with the syntax below.

Additionally, GCM Core respects several GCM-specific [environment variables](environment.md) **which take precedence over configuration options.**
Additionally, GCM Core respects several GCM-specific [environment variables](environment.md) **which take precedence over configuration options**. System administrators may also configure [default values](enterprise-config.md) for many settings used by GCM Core.
derrickstolee marked this conversation as resolved.
Show resolved Hide resolved

GCM Core will only be used by Git if it is installed and configured. Use `git config --global credential.helper manager-core` to assign GCM Core as your credential helper. Use `git config credential.helper` to see the current configuration.

Expand Down
57 changes: 57 additions & 0 deletions docs/enterprise-config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Enterprise configuration defaults

Git Credential Manager Core (GCM Core) can be configured using multiple
different mechanisms. In order of preference, those mechanisms are:

1. [Environment variables](environment.md)
2. [Standard Git configuration files](configuration.md)
1. Repository/local configuration (`.git/config`)
2. User/global configuration (`$HOME/.gitconfig` or `%HOME%\.gitconfig`)
3. Installation/system configuration (`etc/gitconfig`)
3. Operating system specific configuration store
mjcheetham marked this conversation as resolved.
Show resolved Hide resolved

This model largely matches what Git itself supports, namely environment
variables that take precedence over Git configuration files.

The addition of the operating system specific configuration store enables system
mjcheetham marked this conversation as resolved.
Show resolved Hide resolved
administrators to configure defaults for many settings that may be required in
an enterprise or corporate setting.
mjcheetham marked this conversation as resolved.
Show resolved Hide resolved

---

**Important:** We believe the user should _always_ be at liberty to configure
Git and GCM exactly as they wish. By prefering environment variables and Git
configuration files over OS store values, these only act as _default values_
that can always be overriden by the user in the usual ways.
mjcheetham marked this conversation as resolved.
Show resolved Hide resolved

---

## Windows

Default setting values come from the Windows Registry, specifically the
`HKEY_LOCAL_MACHINE` hive under the following key:
mjcheetham marked this conversation as resolved.
Show resolved Hide resolved

```text
mjcheetham marked this conversation as resolved.
Show resolved Hide resolved
SOFTWARE\GitCredentialManager\Configuration
```

By using the Windows Registry system administrators can use Group Policy to
easily set defaults for GCM Core's settings.

The names and possible values of all settings under this key are the same as
those of the [Git configuration](configuration.md) settings.

The type of each registry key can be either `REG_SZ` (string) or `REG_DWORD`
(integer).

**Note:** GCM Core is a 32-bit executable on Windows. When running on a 64-bit
installation of Windows registry access is transparently redirected to the
`WOW6432Node`. This means the actual registry key on 64-bit Windows is:

```text
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\GitCredentialManager\Configuration
```
mjcheetham marked this conversation as resolved.
Show resolved Hide resolved

## macOS/Linux

Default configuration setting stores has not been implemented.
2 changes: 1 addition & 1 deletion docs/environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[Git Credential Manager Core](usage.md) works out of the box for most users. Configuration options are available to customize or tweak behavior.

Git Credential Manager Core (GCM Core) can be configured using environment variables. **Environment variables take precedence over [configuration](configuration.md) options.**
Git Credential Manager Core (GCM Core) can be configured using environment variables. **Environment variables take precedence over [configuration](configuration.md) options**. System administrators may also configure [default values](enterprise-config.md) for many settings used by GCM Core.
mjcheetham marked this conversation as resolved.
Show resolved Hide resolved

For the complete list of environment variables GCM Core understands, see the list below.

Expand Down