It is possible for you to query a particular set of credentials from the credential helper, but there isn't a part of the credential helper protocol that allows you to query all credentials. In general, this is hard, because a credential helper can respond to all credentials that match a pattern, such as https://*.example.org
or https://github.com/bk2204/*
, and that pattern need not match any simple pattern that can be expressed (for example, the helper could have intimate knowledge about which repositories a user has access to based on LDAP).
For the cache
credential helper, there isn't a way to enumerate those credentials.
If you want to look up the credentials for a particular URL, the easiest way to do that is like this:
echo url=https://github.com/git/git.git | git credential fill
That will print the credentials that any credential helper knows about. You can see more about the protocol in the gitcredentials(7)
man page.
~/.git-credentials
? – Expositorcache
Cache credentials in memory for a short period of time. If you are looking towards storing on disk you should usestore
method instead. – Expositor