From 4ecd4aa42a7a43b8ce604911aa9efd3159cc83ba Mon Sep 17 00:00:00 2001 From: Cliff Rowley Date: Fri, 1 Feb 2013 03:56:39 +0000 Subject: [PATCH] Update README.markdown Added a more convenient example of retrieving the GitHub password from the Mac OS keychain. Using "find-internet-password" instead of "find-generic-password" means that a user need not maintain the Keychain entry manually if they change their password, as it will be updated automatically by their browser when they next log into the GitHub website successfully. --- README.markdown | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/README.markdown b/README.markdown index 9984545..5fc1779 100644 --- a/README.markdown +++ b/README.markdown @@ -76,8 +76,16 @@ git config --global github.password "your-github-password" You can also define github.password to be a command which returns the actual password on stdout by setting the variable to a command string prefixed with `!`. For example, the following command fetches the -password from an item named "github.password" on the Mac OS -Keychain: +password from the Mac OS Keychain entry for the GitHub website (if you +allow your browser to save passwords): + +```bash +password = !security find-internet-password -u -s github.com -w | tr -d '\n' +``` + +If you don't allow your browser to save passwords, you can use the following +to fetch the password from a Keychain entry named "github.password" (you'll +also need to create the Keychain entry): ```bash password = !security find-generic-password -gs github.password -w | tr -d '\n'