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

Make GPG Pass store path configurable by git config #1698

Merged
merged 2 commits into from
Sep 30, 2024
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
19 changes: 19 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,24 @@ git config --global credential.dpapiStorePath D:\credentials

---

### credential.gpgPassStorePath

Specify a custom directory to store GPG-encrypted [pass][pass]-compatible credential files
in when [`credential.credentialStore`][credential-credentialstore] is set to `gpg`.

Defaults to the value `~/.password-store` or `%USERPROFILE%\.password-store`.

#### Example

```shell
git config --global credential.gpgPassStorePath /mnt/external-drive/.password-store
```

**Note:** Location of the password store used by [pass][pass] can be overridden by the
`PASSWORD_STORE_DIR` environment variable, see the [man page][pass-man] for details.

---

### credential.msauthFlow

Specify which authentication flow should be used when performing Microsoft
Expand Down Expand Up @@ -1042,6 +1060,7 @@ Defaults to disabled.
[provider-migrate]: migration.md#gcm_authority
[cache-options]: https://git-scm.com/docs/git-credential-cache#_options
[pass]: https://www.passwordstore.org/
[pass-man]: https://git.zx2c4.com/password-store/about/
[trace2-normal-docs]: https://git-scm.com/docs/api-trace2#_the_normal_format_target
[trace2-normal-env]: environment.md#GIT_TRACE2
[trace2-event-docs]: https://git-scm.com/docs/api-trace2#_the_event_format_target
Expand Down
1 change: 1 addition & 0 deletions src/shared/Core/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ public static class Credential
public const string DevUseLegacyUiHelpers = "devUseLegacyUiHelpers";
public const string MsAuthUseDefaultAccount = "msauthUseDefaultAccount";
public const string GuiSoftwareRendering = "guiSoftwareRendering";
public const string GpgPassStorePath = "gpgPassStorePath";

public const string OAuthAuthenticationModes = "oauthAuthModes";
public const string OAuthClientId = "oauthClientId";
Expand Down
3 changes: 2 additions & 1 deletion src/shared/Core/CredentialStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,8 @@ private void ValidateGpgPass(out string storeRoot, out string execPath)
// Check for a redirected pass store location
if (!_context.Settings.TryGetSetting(
GpgPassCredentialStore.PasswordStoreDirEnvar,
null, null,
Constants.GitConfiguration.Credential.SectionName,
Constants.GitConfiguration.Credential.GpgPassStorePath,
out storeRoot))
{
// Use default store root at ~/.password-store
Expand Down
Loading