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, [email protected])
2nd gitlab account (username2, [email protected])
~/.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 = [email protected]
username = username1
Problem is I can only pull from one repo with this configuration and not both. How can make it work for both?