diff options
Diffstat (limited to 'Documentation/gitcredentials.txt')
-rw-r--r-- | Documentation/gitcredentials.txt | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/Documentation/gitcredentials.txt b/Documentation/gitcredentials.txt index 066f825f2e..f3a75d1ce1 100644 --- a/Documentation/gitcredentials.txt +++ b/Documentation/gitcredentials.txt @@ -3,7 +3,7 @@ gitcredentials(7) NAME ---- -gitcredentials - providing usernames and passwords to git +gitcredentials - providing usernames and passwords to Git SYNOPSIS -------- @@ -18,13 +18,13 @@ DESCRIPTION Git will sometimes need credentials from the user in order to perform operations; for example, it may need to ask for a username and password in order to access a remote repository over HTTP. This manual describes -the mechanisms git uses to request these credentials, as well as some +the mechanisms Git uses to request these credentials, as well as some features to avoid inputting these credentials repeatedly. REQUESTING CREDENTIALS ---------------------- -Without any credential helpers defined, git will try the following +Without any credential helpers defined, Git will try the following strategies to ask the user for usernames and passwords: 1. If the `GIT_ASKPASS` environment variable is set, the program @@ -32,7 +32,7 @@ strategies to ask the user for usernames and passwords: to the program on the command line, and the user's input is read from its standard output. -2. Otherwise, if the `core.askpass` configuration variable is set, its +2. Otherwise, if the `core.askPass` configuration variable is set, its value is used as above. 3. Otherwise, if the `SSH_ASKPASS` environment variable is set, its @@ -59,7 +59,7 @@ for a password. It is generally configured by adding this to your config: username = me --------------------------------------- -Credential helpers, on the other hand, are external programs from which git can +Credential helpers, on the other hand, are external programs from which Git can request both usernames and passwords; they typically interface with secure storage provided by the OS or other programs. @@ -79,7 +79,7 @@ store:: You may also have third-party helpers installed; search for `credential-*` in the output of `git help -a`, and consult the documentation of individual helpers. Once you have selected a helper, -you can tell git to use it by putting its name into the +you can tell Git to use it by putting its name into the credential.helper variable. 1. Find a helper. @@ -95,7 +95,7 @@ credential-foo $ git help credential-foo ------------------------------------------- -3. Tell git to use it. +3. Tell Git to use it. + ------------------------------------------- $ git config --global credential.helper foo @@ -103,9 +103,14 @@ $ git config --global credential.helper foo If there are multiple instances of the `credential.helper` configuration variable, each helper will be tried in turn, and may provide a username, -password, or nothing. Once git has acquired both a username and a +password, or nothing. Once Git has acquired both a username and a password, no more helpers will be tried. +If `credential.helper` is configured to the empty string, this resets +the helper list to empty (so you may override a helper set by a +lower-priority config file by configuring the empty-string helper, +followed by whatever set of helpers you would like). + CREDENTIAL CONTEXTS ------------------- @@ -114,7 +119,7 @@ Git considers each credential to have a context defined by a URL. This context is used to look up context-specific configuration, and is passed to any helpers, which may use it as an index into secure storage. -For instance, imagine we are accessing `https://example.com/foo.git`. When git +For instance, imagine we are accessing `https://example.com/foo.git`. When Git looks into a config file to see if a section matches this context, it will consider the two a match if the context is a more-specific subset of the pattern in the config file. For example, if you have this in your config file: @@ -133,18 +138,18 @@ context would not match: username = foo -------------------------------------- -because the hostnames differ. Nor would it match `foo.example.com`; git +because the hostnames differ. Nor would it match `foo.example.com`; Git compares hostnames exactly, without considering whether two hosts are part of the same domain. Likewise, a config entry for `http://example.com` would not -match: git compares the protocols exactly. +match: Git compares the protocols exactly. CONFIGURATION OPTIONS --------------------- Options for a credential context can be configured either in -`credential.\*` (which applies to all credentials), or -`credential.<url>.\*`, where <url> matches the context as described +`credential.*` (which applies to all credentials), or +`credential.<url>.*`, where <url> matches the context as described above. The following options are available in either location: @@ -164,7 +169,7 @@ username:: useHttpPath:: - By default, git does not consider the "path" component of an http URL + By default, Git does not consider the "path" component of an http URL to be worth matching via external helpers. This means that a credential stored for `https://example.com/foo.git` will also be used for `https://example.com/bar.git`. If you do want to distinguish these @@ -175,7 +180,7 @@ CUSTOM HELPERS -------------- You can write your own custom helpers to interface with any system in -which you keep credentials. See the documentation for git's +which you keep credentials. See the documentation for Git's link:technical/api-credentials.html[credentials API] for details. GIT |