Store your git https passwords in your OS X Keychain

Around this time last year [git added a “smart” HTTP transport](http://progit.org/2010/03/04/smart-http.html) that is faster than the old HTTP transport (and in some cases faster than SSH too). And a few months later [GitHub added support for this new HTTP transport](https://github.com/blog/642-smart-http-support) and made it the default selected url for repositories (that you aren’t a contributor for).

There aren’t any major advantages using https over ssh to access your GitHub repositories, it’s just more simple to use your username/password instead of adding your ssh key. The only other advantages is that it’s easier to set up HTTP proxy for git (`git config –global http.proxy proxy:8080` vs ssh config) and being able to use more than one GitHub account (which you shouldn’t since anyone can add you as a contributor to a project).

One major disadvantage is that it asks you for your username/password each time you interact with your remote repository (clone, pull, push, etc). To solve this, I decided to write a program that stores your username and/or password in your keychain so git will ask once for you username/password and retrieve it later so you don’t have to type it again. [If you only want the program, skip to it.](http://samuel.kadolph.com/2011/03/store-your-git-https-passwords-in-your-os-x-keychain/#program)

Continue reading “Store your git https passwords in your OS X Keychain”