I have two separate gitlab
accounts, each with a unique SSH
key and created with a different email
. How can I push/pull
normally (git push origin master / git pull origin master
) from repos in both accounts? Do I have to configure both ~/.gitconfig and ~/.ssh/config?
1st gitlab account (username1, email1@gmail.com)
2nd gitlab account (username2, email2@gmail.com)
~/.ssh/config
Host gitlab.com
User username1
IdentityFile ~/.ssh/id_rsa
Host gitlab.com
User username2
IdentityFile ~/.ssh/id_rsa_
~/.gitconfig
[user]
name = Bob
email = email1@gmail.com
username = username1
Problem is I can only pull from one repo with this configuration and not both. How can make it work for both?