O'Reilly logo

Pro Git, Second Edition by Ben Straub, Scott Chacon

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Under the Hood

How does this all work? Git’s root command for the credential-helper system is git credential, which takes a command as an argument, and then more input through stdin.

This might be easier to understand with an example. Let’s say that a credential helper has been configured, and the helper has stored credentials for mygithost. Here’s a session that uses the fill command, which is invoked when Git is trying to find credentials for a host:

$ git credential fill (1)protocol=https (2)host=mygithost(3)protocol=https (4)host=mygithostusername=bobpassword=s3cre7$ git credential fill (5)protocol=httpshost=unknownhostUsername for 'https://unknownhost': bobPassword for 'https://bob@unknownhost':protocol=httpshost=unknownhostusername=bob ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required