I've followed the GitHub instructions for setting up my account, and I'm able to clone, but I'm unable to push remotely.
When I do a "git push" I get the 403 error. It has the correct URL. I tried a "git credential-osxkeychain get" to see what it was giving, and this prints out the wrong credentials.
I believe what happened is the first time it asked for the credentials, I thought it was another application asking, and it put the wrong ones in.
I just need to reset it so that it uses the correct keychain item for my GitHub account.
I've tried:
git credential-osxkeychain erase
git credential-osxkeychain set
The program never gives any prompts. Set will say "bad input" if I don't do the right thing. I tried putting in "password=password
", etc., but then when I do a "get" I still get the old ones.
I can't figure out where these are being stored, as they are not in .gitconfigure. Further there are no recent keychain items that could be it. (I have several GitHub accounts in my keychain and it is not using any of them.)
The solution turned out to be this:
The command git credential-osxkeychain
was using the first GitHub account entry in my keychain. This one was not the one that had access to the projects in question.
I resolved the problem by touching the account in Keychain Access so that its date changed (I think I just changed the comment) and now that it became the most recent GitHub account it became the first one returned to credential-osxkeychain, and thus everything worked.
A better form of support for multiple GitHub accounts would be nice, but it is likely that most people only have one primary account and don't run into this problem.