Home > Net >  I don't understerstand how I can use git with HTTPS without having to type in my password every
I don't understerstand how I can use git with HTTPS without having to type in my password every

Time:11-02

As far as I know, when you use git with https, you would have to type in your password every time you make a request to github unless you use SSH or you store your credentials locally on your computer with git config credential.helper store .

I've been using HTTPS but never have to type in my credentials. When I run git config --list it only shows my email and my name, but not my password. Can anyone explain to me why I am not required to type in my password or where it could be stored?

CodePudding user response:

I've been using HTTPS but never have to type in my credentials.

That is probably because your credentials are already cached by a credential helper.

  1. Check what yours is: git config --global credential.helper
  2. Check what credentials are stored:

In a Git bash session:

printf "host=github.com\nprotocol=https" | git-credential-xxx get

Replace xxx by the value returned by git config --global credential.helper.

If it is empty, and if the remote URL is an HTTPS one, then, as suggested by LeGEC in the comments, Git might still be using SSH anyway with an url.<base>.pushInsteadOf directive.
Check that with:

git config --show-origin --list --show-scope | grep -i insteadOf

The OP adds in the comments:

running git config --show-origin --list gives me, among other things, file:/Applications/Xcode.app/Contents/Developer/usr/share/git-core/gitconfig credential.helper=osxkeychain
So it could look like it is stored in my osxkeychain?

If that is the case:

printf "host=github.com\nprotocol=https" | git-credential-osxkeychain get

See also "Updating credentials from the macOS Keychain".

  •  Tags:  
  • git
  • Related