git config credential.https://example.com.username myusername git config credential.helper "$helper $options"
1.If the GIT_ASKPASS environment variable is set, the program specified by the variable is invoked. A suitable prompt is provided 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 value is used as above.
3.Otherwise, if the SSH_ASKPASS environment variable is set, its value is used as above.
4.Otherwise, the user is prompted on the terminal.
1.Static configuration of usernames for a given authentication context.
2.Credential helpers to cache or store passwords, or to interact with a system password wallet or keychain.The first is simple and appropriate if you do not have secure storage available for a password. It is generally configured by adding this to your config:
[credential "https://example.com"] username = me
Cache credentials in memory for a short period of time. See git-credential-cache(1) for details.store
Store credentials indefinitely on disk. See git-credential-store(1) for details.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 credential.helper variable.
1.Find a helper.
$ git help -a | grep credential- credential-foo
2.Read its description.
$ git help credential-foo
3.Tell Git to use it.
$ git config --global credential.helper foo
[credential "https://example.com"] username = foo
[credential "https://kernel.org"] username = foo
The name of an external credential helper, and any associated options. If the helper name is not an absolute path, then the string git credential- is prepended. The resulting string is executed by the shell (so, for example, setting this to foo --option=bar will execute git credential-foo --option=bar via the shell. See the manual of specific helpers for examples of their use. 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, 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).username
A default username, if one is not provided in the URL.useHttpPath
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 cases, set this option to true.