Skip to content

How gh manage multiple ssh accounts? #9078

Answered by williammartin
yesidrs asked this question in Q&A
Discussion options

You must be logged in to vote

Well, when you do git clone git@github.com-me:<repo> presumably git is looking at your .ssh/config, finds:

Host github.com-me
  HostName github.com
  User git
  IdentityFile ~/.ssh/personal_key

And uses ~/.ssh/personal_key to authenticate.

When you do gh repo clone it's trying to clone git@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…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@yesidrs
Comment options

@williammartin
Comment options

Answer selected by yesidrs
@yesidrs
Comment options

@yesidrs
Comment options

@williammartin
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants