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: 1 comment 5 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.
Well, when you do
git clone git@github.com-me:<repo>
presumablygit
is looking at your.ssh/config
, finds:And uses
~/.ssh/personal_key
to authenticate.When you do
gh repo clone
it's trying to clonegit@github.com:<repo>
which will not find the correct key.If your question is "how does
gh
work with.ssh/config
entries 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
gh
support using multiple accounts on github.com" then https://github.com/cli/cli/blob/4b077daf7e74dbe6bf933f69e220066e3a12e8b4/docs/multiple-accounts.md is c…