I have configured my machine to use one account for a github project for a while now. Now I am going to start participating in another project and decided to use a different github account.
I tried to set the configuration for the new repository locally, but it didn’t seem to help:
$ mkdir github
$ cd github/
$ git init
Initialized empty Git repository in /Users/.../Sites/.../github/.git/
$ git config user.name "..."
$ git config user.email "..."
$ git config github.user SECOND ACCOUNT NAME
$ git config github.token SECOND ACCOUNT TOKEN
$ git clone git@github.com:.../....git
Initialized empty Git repository in /Users/.../Sites/.../github/.../.git/
ERROR: Permission to .../... denied to FIRST_ACCOUNT.
fatal: The remote end hung up unexpectedly
Is there something else I need to do?
Thanks!
You could create another Unix-user to work on that second project, that would minimise complication. Else you would have to change the email-address back and forth (as Github connects the commit and the account by comparing the email-addresses and would thus probably refer to the wrong account in the commit).
To the connection issue: Have you uploaded your SSH key to Github for the second account?