If you use more than one SSH key (e.g., personal and company) on your computer:
Create a file ~/.ssh/config
with the following content:
# Personal GitHub account
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_personal
AddKeysToAgent yes
UseKeychain yes
# Company GitHub account
Host github.com-company
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_company
AddKeysToAgent yes
UseKeychain yes
Then add the keys using the following commands:
ssh-add ~/.ssh/id_rsa_personal
ssh-add ~/.ssh/id_rsa_company
Check if the keys have been correctly added to the agent:
ssh-add -l