Use a secondary Github account
Create a new pair of keys
ssh-keygen -t ed25519 -C "your_email@example.com"
This will generate a file in ~/.ssh/
(eg id_ed25519
). Add the .pub
in your profile’s Settings
/SSH and GPG keys
.
Edit .git/config
to add:
sshCommand = ssh -i ~/.ssh/id_ed25519
How to merge two Github accounts
Short answer: it’s not directly possible to merge two accounts. However, it’s possible to transfer repositories and most of the ownership of the commits.
Transfer repositories
For each repository, go to the repository’s Settings
, scroll down to Transfer ownership
, fill the form with your other username, and accept the transfer by clicking on the link you will receive by mail.
Transfer (most of) the commits
Go to your profile’s Settings
, select Emails
, add a new email (your gmail with a +suffix
works), and delete the old email. Go to the other account and add the email there. When you do it, most of the commits will be attributed to the other account in regards to the contributions
’s diagram on your front page.