When executing 'git credential-osxkeychain' in MacOS, it shows the option 'store' and I guess it can be used to add the credentials.
I didn't find any documentation about the syntax required to add credentials using the command 'git credential-osxkeychain store', anyone knows how to do it?
Please notice that I do know how to do it using the MacOS app 'Keychain Access', I'd like to know how to do it using the command line
If you're using a Mac, Git comes with an “osxkeychain” mode, which caches credentials in the secure keychain that's attached to your system account. This method stores the credentials on disk, and they never expire, but they're encrypted with the same system that stores HTTPS certificates and Safari auto-fills.
Git has an internal interface for storing and retrieving credentials from system-specific helpers, as well as prompting the user for usernames and passwords. The git-credential command exposes this interface to scripts which may want to retrieve, store, or prompt for credentials in the same manner as Git.
git credential-osxkeychain store
reads protocol/host/username/password from stdin separated by newlines, so feed them something like this:
echo "\
protocol=https
host=github.com
username=$NAME
password=$PASSWD" | git credential-osxkeychain store
All 4 parameters are required.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With