How gh manage multiple ssh accounts? #9078
-
|
I have two GitHub accounts, one for work and one for personal use. Normally, in my .ssh/config, I create two hosts, each linked to its respective SSH key. When using What solution is there? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 7 replies
-
|
Hi @yesiddev, I don't understand the exact situation you are facing sorry. I'd need to see the exact commands you are running with I think normally you are trying to use two different accounts on github.com and authenticate with git via SSH keys, and then you are setting up your What would you like to be happening? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
made life a bit easier: https://github.com/samyou/sshgit |
Beta Was this translation helpful? Give feedback.



Well, when you do
git clone git@github.com-me:<repo>presumablygitis looking at your.ssh/config, finds:And uses
~/.ssh/personal_keyto authenticate.When you do
gh repo cloneit's trying to clonegit@github.com:<repo>which will not find the correct key.If your question is "how does
ghwork with.ssh/configentries to use different keys for different repos on github.com" the answer is that it doesn't support it.If your question is "how does
ghsupport using multiple accounts on github.com" then https://github.com/cli/cli/blob/4b077daf7e74dbe6bf933f69e220066e3a12e8b4/docs/multiple-accounts.md is c…