Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have two GitHub accounts on the same Mac. And have credential-osxkeychain installed. It works fine with my first GitHub account. But, how can I add the second account into the keychain access? If it is not possible, how can I 'logout' my first account?

P.S. I can't use SSH key on my network.

P.S. I have already set git config & git config at the second repo. Error 403 show up when I git push. Github didn't ask me for the password of the second account. I think git is pushing the repo with the wrong account & password.

share|improve this question

migrated from Sep 8 '12 at 16:35

This question came from our site for professional and enthusiast programmers.

I know it's possible to configure a single repository with git config --local for a particular user. But there must be another way. – fabiopagoti Sep 7 '12 at 19:59
I have set the git config & git config for that repo. But I got error 403 when I push it. – user1597243 Sep 8 '12 at 10:28
3 and have nothing to do with authentication, these are just values which are recorded during commit. – knittl Sep 8 '12 at 12:23
then how to add another account to authentication? – user1597243 Sep 8 '12 at 18:34
Why do you even need two github accounts? FWIW authentication is done via the push url (which is normally starting with ssh://) – knittl Sep 8 '12 at 18:44

If you're trying to use SSH authentication, Github is probably seeing the first ssh key and associating it with the first account, then denying that account access to the second account's repos. I suggest switching one or both of the accounts to http based access.

For example, over SSH my repo URL would be: while the HTTP equivalent would be:

When pushing or pulling with the HTTP url, git will prompt for the username and password allowing you to specify which of the two Github accounts to use. That also saves you from mucking about with ssh keys.

Hope this helps!

share|improve this answer
up vote 0 down vote accepted

Lastly, I go to Keychain Access and delete/modify the entry of Thus, I can login another account when pushing.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.