简体   繁体   中英

how to add credentials from the command line using 'git credential-osxkeychain store'?

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

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM