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 ...