Skip to content

Commit e278794

Browse files
authored
Merge pull request #547 from GitCredentialManager/vtbassmatt-fixes
Batch of documentation fixes
2 parents ff08037 + 894eda2 commit e278794

File tree

4 files changed

+95
-1
lines changed

4 files changed

+95
-1
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,13 @@ __Note:__ Although packages were previously offered on certain
101101
GCM no longer publishes to these repositories. Please install the
102102
Debian package using the above instructions instead.
103103

104+
To uninstall:
105+
106+
```shell
107+
git-credential-manager-core unconfigure
108+
sudo dpkg -r gcmcore
109+
```
110+
104111
#### Other distributions
105112

106113
Download the latest [tarball](https://github.com/GitCredentialManager/git-credential-manager/releases/latest), and run the following:
@@ -110,6 +117,13 @@ tar -xvf <path-to-tarball> -C /usr/local/bin
110117
git-credential-manager-core configure
111118
```
112119

120+
To uninstall:
121+
git-credential-manager-core unconfigure
122+
rm $(command -v git-credential-manager-core)
123+
```shell
124+
125+
```
126+
113127
**Note:** all Linux distributions [require additional configuration](https://aka.ms/gcm/credstores) to use GCM.
114128

115129
---

docs/autodetect.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ In order to detect which host provider to use for a self-hosted instance, each
1818
provider can provide some heuristic matching of the hostname. For example any
1919
hostname that begins "github.*" will be matched to the GitHub host provider.
2020

21-
If a heuristic matches incorrectly, you can always [explicitly configure](#explicit-configuration)
21+
If a heuristic matches incorrectly, you can always [explicitly configure](#manual-configuration)
2222
GCM to use a particular provider.
2323

2424
## Remote URL probing

docs/faq.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,30 @@ We are happy to accept proposals and/or contributions to enable GCM to run on ot
8282
Due to the design of Git and credential helpers such as GCM, we need this setting to make Git use the full remote URL (including the path component) when communicating with GCM. The new `dev.azure.com` format of Azure DevOps URLs means the account name is now part of the path component (for example: `https://dev.azure.com/contoso/...`). The Azure DevOps account name is required in order to resolve the correct authority for authentication (which Azure AD tenant backs this account, or if it is backed by Microsoft personal accounts).
8383

8484
In the older GCM for Windows product, the solution to the same problem was a "hack". GCM for Windows would walk the process tree looking for the `git-remote-https.exe` process, and attempt to read/parse the process environment block looking for the command line arguments (that contained the full remote URL). This is fragile and not a cross-platform solution, hense the need for the `credential.useHttpPath` setting with GCM.
85+
86+
### Why does GCM take so long at startup the first time?
87+
88+
GCM will [autodetect](autodetect.md) what kind of Git host it's talking to. GitHub, Bitbucket, and Azure DevOps each have their own form(s) of authentication, plus there's a "generic" username and password option.
89+
90+
For the hosted versions of these services, GCM can guess from the URL which service to use. But for on-premises versions which would have unique URLs, GCM will probe with a network call. GCM caches the results of the probe, so it should be faster on the second and later invocations.
91+
92+
If you know which provider you're talking to and want to avoid the probe, that's possible. You can explicitly tell GCM which provider to use for a URL "example.com" like this:
93+
94+
|| Provider || Command ||
95+
|-----------|----------|
96+
| GitHub | `git config --global credential.https://example.com.provider github`
97+
| Bitbucket | `git config --global credential.https://example.com.provider bitbucket`
98+
| Azure DevOps | `git config --global credential.https://example.com.provider azure-repos`
99+
| Generic | `git config --global credential.https://example.com.provider generic`
100+
101+
### How do I fix "Could not create SSL/TLS secure channel" errors on Windows 7?
102+
103+
This likely indicates that you don't have newer TLS versions available. Please [follow Microsoft's guide](https://support.microsoft.com/topic/update-to-enable-tls-1-1-and-tls-1-2-as-default-secure-protocols-in-winhttp-in-windows-c4bd73d2-31d7-761e-0178-11268bb10392) for enabling TLS 1.1 and 1.2 on your machine, specifically the **SChannel** instructions. You'll need to be on at least Windows 7 SP1, and in the end you should have a `TLS 1.2` key with `DisabledByDefault` set to `0`. You can also read [more from Microsoft](https://docs.microsoft.com/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/dn786418(v=ws.11)#tls-12) on this change.
104+
105+
### How do I use GCM with Windows Subsystem for Linux (WSL)?
106+
107+
Follow the instructions in [our WSL guide](wsl.md) carefully. Especially note the need to run `git config --global credential.https://dev.azure.com.useHttpPath true` _within_ WSL if you're using Azure DevOps.
108+
109+
### Does GCM work with multiple users? If so, how?
110+
111+
That's a fairly complicated question to answer, but in short, yes. See [our document on multiple users](multiple-users.md) for details.

docs/multiple-users.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Multiple users
2+
3+
If you work with multiple different identities on a single Git hosting service, you may be wondering if Git Credential Manager (GCM) supports this workflow. The answer is yes, with a bit of complexity due to how it interoperates with Git.
4+
5+
## Foundations: Git and Git hosts
6+
7+
Git itself doesn't have a single, strong concept of "user". There's the `user.name` and `user.email` which get embedded into commit headers/trailers, but these are arbitrary strings. GCM doesn't interact with this notion of a user at all. You can put whatever you want into your `user.*` config, and nothing in GCM will change at all.
8+
9+
Separate from the user strings in commits, Git recognizes the "user" part of a remote URL or a credential. These are not often used, at least by default, in the web UI of major Git hosts.
10+
11+
Git hosting providers (like GitHub or Bitbucket) _do_ have a concept of "user". Typically it's an identity like a username or email address, plus a password or other credential to perform actions as that user. You may have guessed by now that GCM (the Git **Credential** Manager) does work with this notion of a user.
12+
13+
## People, identities, credentials, oh my!
14+
15+
You (a physical person) may have one or more user accounts (identities) with one or more Git hosting providers. Since most Git hosts don't put a "user" part in their URLs, by default, Git will treat the user part for a remote as the empty string. If you have multiple identites on one domain, you'll need to insert a unique user part per-identity yourself.
16+
17+
There are good reasons for having multiple identities on one domain. You might use one GitHub identity for your personal work, another for your open source work, and a third for your employer's work. You can ask Git to assign a different credential to different repositories hosted on the same provider. HTTPS URLs include an optional "name" part before an `@` sign in the domain name, and you can use this to force Git to distiguish multiple users. This should likely be your username on the Git hosting service, since there are cases where GCM will use it like a username.
18+
19+
## Setting it up
20+
21+
As an example, let's say you're working on multiple repositories hosted at the same domain name.
22+
23+
| Repo URL | Identity |
24+
|----------|----------|
25+
| `https://example.com/open-source/library.git` | `contrib123` |
26+
| `https://example.com/more-open-source/app.git` | `contrib123` |
27+
| `https://example.com/big-company/secret-repo.git` | `employee9999` |
28+
29+
When you clone these repos, include the identity and an `@` before the domain name in order to force Git and GCM to use different identities. If you've already cloned the repos, you can update the remote URL to incude the identity.
30+
31+
### Example: fresh clones
32+
33+
```shell
34+
# instead of `git clone https://example.com/open-source/library.git`, run:
35+
git clone https://[email protected]/open-source/library.git
36+
37+
# instead of `git clone https://example.com/big-company/secret-repo.git`, run:
38+
git clone https://[email protected]/big-company/secret-repo.git
39+
```
40+
41+
### Example: existing clones
42+
43+
```shell
44+
# in the `library` repo, run:
45+
git remote set-url origin https://[email protected]/open-source/library.git
46+
47+
# in the `secret-repo` repo, run:
48+
git remote set-url origin https://[email protected]/big-company/secret-repo.git
49+
```
50+
51+
## Azure DevOps
52+
53+
[Azure DevOps has some additional, optional complexity](azrepos-users-and-tokens.md) which you should also be aware of if you're using it.

0 commit comments

Comments
 (0)