Github uses the email address to identify the user behind a specific commit.
If you import a ssh key with another email address, chances are the commits will not be linked to the proper account.

Here is the setup to use to be able to use several github account on the same machine using SSH keys

ssh config

generate a set off keys for each account with the following command

ssh-keygen -t rsa -C ""
ssh-keygen -t rsa -C ""

Name the files so as to have in .ssh


create a .ssh/config file

touch ~/.ssh/config
chmod 644 ~/.ssh/config

and put the following in ~/.ssh/config

Host github-primary
IdentityFile ~/.ssh/id_rsa_primary
User git

Host github-secondary
IdentityFile ~/.ssh/id_rsa_another
User git

cloning a repository

Clone the repository as usual
and set the identity that should be used

git clone
cd myproject
git config "another user name"
git config ""

And you’re done, the rest is normal git flow