Github

Multiple Github Accounts

If you have multiple GitHub accounts, say one for work and one for personal projects, you have likely faced the same question: what is the best way to manage and switch between them?

Fortunately, it can easily be done by using SSH config.

Step 1. Generate ssh key for each account

# Personal account
ssh-keygen -t ed25519 -C "[email protected]"
# Save as: ~/.ssh/id_ed25519_personal

# Work account
ssh-keygen -t ed25519 -C "[email protected]"
# Save as: ~/.ssh/id_ed25519_work

Add the public key to its corresponding GitHub account.