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
generate a set off keys for each account with the following command
ssh-keygen -t rsa -C "email@example.com" ssh-keygen -t rsa -C "firstname.lastname@example.org"
Name the files so as to have in .ssh
id_rsa_primary id_rsa_primary.pub id_rsa_another id_rsa_another.pub
create a .ssh/config file
touch ~/.ssh/config chmod 644 ~/.ssh/config
and put the following in ~/.ssh/config
Host github-primary HostName github.com IdentityFile ~/.ssh/id_rsa_primary User git Host github-secondary HostName github.com 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 email@example.com:another/myproject.git cd myproject git config user.name "another user name" git config user.email "firstname.lastname@example.org"
And you’re done, the rest is normal git flow