Skip to content

Commit 4123596

Browse files
authored
Merge pull request #339 from microsoft/master
Cut new release
2 parents 3fc6791 + 39efe03 commit 4123596

File tree

25 files changed

+431
-198
lines changed

25 files changed

+431
-198
lines changed

.github/ISSUE_TEMPLATE/auth-problem.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: Authentication failure
33
about: An authentication problem occurred when running a Git command.
44
title: ''
5-
labels: 'auth-failure'
5+
labels: 'auth-issue'
66
assignees: ''
77
---
88

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
name: Experimental feature issues
3+
about: A problem or issue occurred when using an experimental feature.
4+
title: ''
5+
labels: 'experimental'
6+
assignees: ''
7+
---
8+
9+
**Which version of GCM Core are you using?**
10+
11+
From a terminal, run `git-credential-manager-core version` and paste the output.
12+
13+
<!-- Ex:
14+
Git Credential Manager version 2.0.8-beta+e1f8492d04 (macOS, .NET Core 4.6.27129.04)
15+
-->
16+
17+
**Which Git host provider are you trying to connect to?**
18+
19+
* [ ] Azure DevOps
20+
* [ ] Azure DevOps Server (TFS/on-prem)
21+
* [ ] GitHub
22+
* [ ] GitHub Enterprise
23+
* [ ] Bitbucket
24+
* [ ] Other - please describe
25+
26+
**Can you access the remote repository directly in the browser using the remote URL?**
27+
28+
From a terminal, run `git remote -v` to see your remote URL.
29+
30+
<!-- Ex:
31+
origin https://dev.azure.com/contoso/_git/widgets
32+
-->
33+
34+
* [ ] Yes
35+
* [ ] No, I get a permission error
36+
* [ ] No, for a different reason - please describe
37+
38+
---
39+
40+
**_[Azure DevOps only]_ What format is your remote URL?**
41+
42+
* [ ] Not applicable
43+
* [ ] https://dev.azure.com/`{org}`/...
44+
* [ ] https://`{org}`@dev.azure.com/`{org}`/...
45+
* [ ] https://`{org}`.visualstudio.com/...
46+
47+
**_[Azure DevOps only]_ If the account picker shows more than one identity as you authenticate, check that you selected the same one that has access on the web.**
48+
49+
* [ ] Not applicable
50+
* [ ] I only see one identity
51+
* [ ] I checked each identity and none worked
52+
53+
---
54+
55+
**Expected behavior**
56+
57+
I am authenticated and my Git operation completes successfully.
58+
59+
**Actual behavior**
60+
61+
A clear and concise description of what happens. For example: exception is thrown, UI freezes, etc.
62+
63+
**Logs**
64+
65+
Set the environment variables `GCM_TRACE=1` and `GIT_TRACE=1` and re-run your Git command. Review and redact any private information and attach the log.

.github/workflows/release-winget.yaml

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,29 @@ jobs:
77
release:
88
runs-on: ubuntu-latest
99
steps:
10-
- name: Update winget repository
11-
uses: mjcheetham/[email protected]
10+
- id: update-winget
11+
name: Update winget repository
12+
uses: mjcheetham/[email protected]
1213
with:
13-
token: ${{ secrets.WINGET_TOKEN }}
14-
repo: microsoft/winget-pkgs
1514
id: Microsoft.GitCredentialManagerCore
15+
token: ${{ secrets.WINGET_TOKEN }}
1616
releaseAsset: gcmcore-win-x86-(.*)\.exe
1717
manifestText: |
18-
Id: {{id}}
19-
Version: {{version}}
20-
Name: Git Credential Manager Core
18+
PackageIdentifier: {{id}}
19+
PackageVersion: {{version}}
20+
PackageName: Git Credential Manager Core
2121
Publisher: Microsoft Corporation
22-
AppMoniker: git-credential-manager-core
23-
Homepage: https://aka.ms/gcmcore
24-
Tags: "gcm, gcmcore, git, credential"
22+
Moniker: git-credential-manager-core
23+
PackageUrl: https://aka.ms/gcmcore
24+
Tags: [ gcm, gcmcore, git, credential ]
2525
License: Copyright (C) Microsoft Corporation
26-
Description: Secure, cross-platform Git credential storage with authentication to GitHub, Azure Repos, and other popular Git hosting services.
26+
ShortDescription: Secure, cross-platform Git credential storage with authentication to GitHub, Azure Repos, and other popular Git hosting services.
2727
Installers:
28-
- Arch: x86
29-
Url: {{url}}
30-
InstallerType: Inno
31-
Sha256: {{sha256}}
28+
- Architecture: x86
29+
InstallerUrl: {{url}}
30+
InstallerType: inno
31+
InstallerSha256: {{sha256}}
32+
PackageLocale: en-US
33+
ManifestType: singleton
34+
ManifestVersion: 1.0.0
3235
alwaysUsePullRequest: true

docs/azrepos-users-and-tokens.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,18 @@ The Azure Repos host provider supports creating multiple types of credential:
77
- Azure DevOps personal access tokens
88
- Microsoft identity OAuth tokens (experimental)
99

10+
To select which type of credential the Azure Repos host provider will create
11+
and use, you can set the [`credential.azreposCredentialType`](https://github.com/microsoft/Git-Credential-Manager-Core/blob/master/docs/configuration.md#credentialazreposcredentialtype-experimental)
12+
configuration entry (or [`GCM_AZREPOS_CREDENTIALTYPE`](https://github.com/microsoft/Git-Credential-Manager-Core/blob/master/docs/environment.md#GCM_AZREPOS_CREDENTIALTYPE-experimental)
13+
environment variable).
14+
1015
### Azure DevOps personal access tokens
1116

1217
Historically, the only option supported by the Azure Repos host provider was
1318
Azure DevOps Personal Access Tokens (PATs).
1419

1520
These PATs are only used by Azure DevOps, and must be [managed through the Azure
16-
DevOps user settings page](https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops&tabs=preview-page).
21+
DevOps user settings page](https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops&tabs=preview-page) or [REST API](https://docs.microsoft.com/en-gb/rest/api/azure/devops/tokens/pats).
1722

1823
PATs have a limited lifetime and new tokens must be created once they expire. In
1924
Git Credential Manager, when a PAT expired (or was manually revoked) this

docs/configuration.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,12 @@ git config --global credential.plaintextStorePath /mnt/external-drive/credential
256256

257257
Specify which authentication flow should be used when performing Microsoft authentication and an interactive flow is required.
258258

259-
Defaults to the value `auto`.
259+
Defaults to `auto`.
260+
261+
**Note:** If [`credential.msauthUseBroker`](#credentialmsauthusebroker) is set
262+
to `true` and the operating system authentication broker is available, all flows
263+
will be delegated to the broker. If both of those things are true, then the
264+
value of `credential.msauthFlow` has no effect.
260265

261266
Value|Authentication Flow
262267
-|-
@@ -275,6 +280,27 @@ git config --global credential.msauthFlow devicecode
275280

276281
---
277282

283+
### credential.msauthUseBroker
284+
285+
Use the operating system account manager where available.
286+
287+
Defaults to `false`. This default is subject to change in the future.
288+
289+
Value|Description
290+
-|-
291+
`true`|Use the operating system account manager as an authentication broker.
292+
`false` _(default)_|Do not use the broker.
293+
294+
#### Example
295+
296+
```shell
297+
git config --global credential.msauthUseBroker true
298+
```
299+
300+
**Also see: [GCM_MSAUTH_USEBROKER](environment.md#GCM_MSAUTH_USEBROKER)**
301+
302+
---
303+
278304
### credential.useHttpPath
279305

280306
Tells Git to pass the entire repository URL, rather than just the hostname, when calling out to a credential provider. (This setting [comes from Git itself](https://git-scm.com/docs/gitcredentials/#Documentation/gitcredentials.txt-useHttpPath), not GCM Core.)

docs/development.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Start by cloning this repository:
66
git clone https://github.com/microsoft/Git-Credential-Manager-Core
77
```
88

9+
You also need the latest version of the .NET SDK which can be downloaded and installed from [here](https://dotnet.microsoft.com/).
10+
911
## Building
1012

1113
The `Git-Credential-Manager.sln` solution can be opened and built in Visual Studio, Visual Studio for Mac, Visual Studio Code, or JetBrains Rider.
@@ -31,8 +33,7 @@ To build from inside an IDE, make sure to select the `WindowsDebug` or `WindowsR
3133
To build from the command line, run:
3234

3335
```powershell
34-
msbuild /t:restore /p:Configuration=WindowsDebug
35-
msbuild /p:Configuration=WindowsDebug
36+
dotnet build -c WindowsDebug
3637
```
3738

3839
You can find a copy of the installer .exe file in `out\windows\Installer.Windows\bin\Debug\net472`.

docs/environment.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Environment variables
22

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

55
Git Credential Manager Core (GCM Core) can be configured using environment variables. **Environment variables take precedence over [configuration](configuration.md) options.**
66

@@ -402,7 +402,12 @@ export GCM_PLAINTEXT_STORE_PATH=/mnt/external-drive/credentials
402402

403403
Specify which authentication flow should be used when performing Microsoft authentication and an interactive flow is required.
404404

405-
Defaults to the value `auto`.
405+
Defaults to `auto`.
406+
407+
**Note:** If [`GCM_MSAUTH_USEBROKER`](#gcm_msauth_usebroker) is set to `true`
408+
and the operating system authentication broker is available, all flows will be
409+
delegated to the broker. If both of those things are true, then the value of
410+
`GCM_MSAUTH_FLOW` has no effect.
406411

407412
Value|Authentication Flow
408413
-|-
@@ -427,6 +432,33 @@ export GCM_MSAUTH_FLOW="devicecode"
427432

428433
---
429434

435+
### GCM_MSAUTH_USEBROKER
436+
437+
Use the operating system account manager where available.
438+
439+
Defaults to `false`. This default is subject to change in the future.
440+
441+
Value|Description
442+
-|-
443+
`true`|Use the operating system account manager as an authentication broker.
444+
`false` _(default)_|Do not use the broker.
445+
446+
##### Windows
447+
448+
```batch
449+
SET GCM_MSAUTH_USEBROKER="true"
450+
```
451+
452+
##### macOS/Linux
453+
454+
```bash
455+
export GCM_MSAUTH_USEBROKER="false"
456+
```
457+
458+
**Also see: [credential.msauthUseBroker](configuration.md#credentialmsauthusebroker)**
459+
460+
---
461+
430462
### GCM_AZREPOS_CREDENTIALTYPE _(experimental)_
431463

432464
Specify the type of credential the Azure Repos host provider should return.

src/osx/Installer.Mac/scripts/postinstall

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ fi
3030
mkdir -p /usr/local/bin
3131
/bin/ln -Fs "$INSTALL_DESTINATION/git-credential-manager-core" /usr/local/bin/git-credential-manager-core
3232

33-
# Configure GCM for the current user
34-
"$INSTALL_DESTINATION/git-credential-manager-core" configure
33+
# Configure GCM for the current user (running as the current user to avoid root
34+
# from taking ownership of ~/.gitconfig)
35+
sudo -u ${USER} "$INSTALL_DESTINATION/git-credential-manager-core" configure
3536

3637
exit 0

src/osx/Installer.Mac/uninstall.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ then
1010
exit $?
1111
fi
1212

13-
# Unconfigure
13+
# Unconfigure (as the current user)
1414
echo "Unconfiguring credential helper..."
15-
"$GCMBIN" unconfigure
15+
sudo -u `/usr/bin/logname` "$GCMBIN" unconfigure
1616

1717
# Remove symlink
1818
if [ -L /usr/local/bin/git-credential-manager-core ]

src/shared/Git-Credential-Manager/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ public static class Program
1515
public static void Main(string[] args)
1616
{
1717
string appPath = GetApplicationPath();
18-
using (var context = new CommandContext())
19-
using (var app = new Application(context, appPath))
18+
using (var context = new CommandContext(appPath))
19+
using (var app = new Application(context))
2020
{
2121
// Register all supported host providers at the normal priority.
2222
// The generic provider should never win against a more specific one, so register it with low priority.

0 commit comments

Comments
 (0)