SSH Config 1
~/.ssh/config
If the file does not exist, create it manually
Host account_a.gitlab.com
Hostname gitlab.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/account_a_priv_key
Host account_b.gitlab.com
Hostname gitlab.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/account_b_priv_key
Host account_c.github.com
Hostname github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/account_c_priv_key
git remote set-url origin git@account_a.gitlab.com:to/repo.git
If encountering SSH key authentication issues, try this script to re-add the key