Git - Credential

> Code - (Programming|Computer) Language > Code Versioning > Git

1 - About

Git makes use of a credential helper (an external utility) to be able to retrieve the credentials)

The id of a credential (user, ww) is a URL (Credential context)

It will lookup a credential with the user, protocol, host. By order of precedence, Git will search the following credential URL to find a credential

2 - Management

2.1 - Helper

2.1.1 - Get

Which credential helper use git now ?

git config --global credential.helper
manager
Advertising

2.1.2 - List

git help -a | grep credential-
  credential-manager      merge-recursive         submodule--helper
  credential-store        merge-resolve           subtree
  credential-wincred      merge-subtree           svn

2.1.3 - Help

First, list them, then you can ask the help for one of them with the below command.

Example for credential-store

git help credential-store

2.1.4 - Config

Git - Config

git config --global credential.helper foo
#where foo is your credential helper

Example:

git config --global credential.helper manager
  • for Git Credential Store (File System)
git config --global credential.helper store
Advertising

2.2 - Credentials

2.2.1 - Set

  • In a url, it works only for ssh or https:
git clone https://username:[email protected]b.com/username/repository.git
  • Setting the username
git config --global credential.helper cache
git config credential.https://hostname.username myusername

3 - Documentation / Reference

code/version/git/credential.txt · Last modified: 2018/09/26 10:13 by gerardnico