I have multiple git repo (Client1, Client2, personal).
I did configured the profiles as suggested here.
https://medium.com/@trionkidnapper/ssh-keys-with-multiple-github-accounts-c67db56f191e
Now my config file have 3 different profiles.
Host github.com
HostName github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa_personal
Host gitlab.client1.com
HostName github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa_client_a
Host github.com/client2.com
HostName github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa_client_b
Till yesterday everything is fine, whenever I do git pull or push for client_a corresponding IdentityFile is using for the changes to pull or push.
Today When I tried to do git pull on client b repo ~/.ssh/id_rsa_personal
is going to be used instead of ~/.ssh/id_rsa_client_b
and it's failing as it is not the intended one(permission issue). Not sure how to point to ~/.ssh/id_rsa_client_b
instead of ~/.ssh/id_rsa_personal
.
Any thoughts?