Musings of an 8-bit Vet

A Student Coders Tech Diary

When Github Keeps Asking for a Password

If everytime you go to do a remote connect (e.g. push) to github and it requests your github password, then you have most likely have a problem with your credential helper.

The credential helper is part of a standard github or homebrew install. But sometimes things don’t go as planned, or perhaps your github install was part of a larger “all-in-one” install and something got improperly configured.

The good new is it’s an easy enough problem to fix.

These instructions apply to OS X, but you can check GitHub Help for your platform.

1: First, check to see if you have the credential helper installed:

1
$ git credential-osxkeychain

If you get the following then it is installed, go to step 3:

1
usage: git credential-osxkeychain <get|store|erase>

But if you get, go to step 2:

1
git: 'credential-osxkeychain' is not a git command. See 'git --help'.

2: Then you need to install and configure it with:

1
2
3
4
5
6
7
8
9
10
# Download the file
curl -s -O \
  http://github-media-downloads.s3.amazonaws.com/osx/git-credential-osxkeychain

# Fix the permissions
chmod u+x git-credential-osxkeychain

# Move it to the right path, sudo may require your password.
sudo mv git-credential-osxkeychain \
  "$(dirname $(which git))/git-credential-osxkeychain"

3: Lastly, modify your git config file to use the helper:

1
$ git config --global credential.helper osxkeychain

The next time you push you’ll be asked for your github password, but after that it should be remembered in your OS X keychain for each subsequent remote access request.

Thanx for reading. Stay tuned for more from the front lines…