Skip to content

Commit 8a699db

Browse files
authored
Merge pull request #285 from microsoft/docs/useHttpPath
documented behavior under `credential.useHttpPath`
2 parents 307e936 + 6bbbdd3 commit 8a699db

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

docs/configuration.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,3 +249,64 @@ git config --global credential.msauthFlow devicecode
249249
```
250250

251251
**Also see: [GCM_MSAUTH_FLOW](environment.md#GCM_MSAUTH_FLOW)**
252+
253+
---
254+
255+
### credential.useHttpPath
256+
257+
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.)
258+
259+
Defaults to `false`.
260+
261+
**Note:** GCM Core sets this value to `true` for `dev.azure.com` (Azure Repos) hosts after installation by default.
262+
263+
This is because `dev.azure.com` alone is not enough information to determine the correct Azure authentication authority - we require a part of the path. The fallout of this is that for `dev.azure.com` remote URLs we do not support storing credentials against the full-path. We always store against the `dev.azure.com/org-name` stub.
264+
265+
In order to use Azure Repos and store credentials against a full-path URL, you must use the `org-name.visualstudio.com` remote URL format instead.
266+
267+
Value|Git Behavior
268+
-|-
269+
`false` _(default)_|Git will use only `user` and `hostname` to look up credentials.
270+
`true`|Git will use the full repository URL to look up credentials.
271+
272+
#### Example
273+
274+
On Windows using GitHub, for a user whose login is `alice`, and with `credential.useHttpPath` set to `false` (or not set), the following remote URLs will use the same credentials:
275+
276+
```text
277+
Credential: "git:https://github.com" (user = alice)
278+
279+
https://github.com/foo/bar
280+
https://github.com/contoso/widgets
281+
https://[email protected]/contoso/widgets
282+
```
283+
```text
284+
Credential: "git:https://[email protected]" (user = bob)
285+
286+
https://[email protected]/foo/bar
287+
https://[email protected]/example/myrepo
288+
```
289+
290+
Under the same user but with `credential.useHttpPath` set to `true`, these credentials would be used:
291+
292+
```text
293+
Credential: "git:https://github.com/foo/bar" (user = alice)
294+
295+
https://github.com/foo/bar
296+
```
297+
```text
298+
Credential: "git:https://github.com/contoso/widgets" (user = alice)
299+
300+
https://github.com/contoso/widgets
301+
https://[email protected]/contoso/widgets
302+
```
303+
```text
304+
Credential: "git:https://[email protected]/foo/bar" (user = bob)
305+
306+
https://[email protected]/foo/bar
307+
```
308+
```text
309+
Credential: "git:https://[email protected]/example/myrepo" (user = bob)
310+
311+
https://[email protected]/example/myrepo
312+
```

0 commit comments

Comments
 (0)