title |
---|
How to Setup & Connect Additional Github.com Account(s) to the Github CLI |
Assuming you've already created your additional Github account, here are the steps:
- Generate a PAT (personal access token) // not going to go through these steps
- Generate an SSH key
- Connect your account to github
// not going to go through these steps
In your terminal, run the following command and then follow the obvious prompts:
ssh-keygen -t ed25519 -C "<your-github-account-email>"
In terminal, run the following command and then follow the obvious prompts:
gh auth login
Prompts:
- What account do you want to log into?: GitHub.com
- What is your preferred protocol for Git operations on this host?: SSH
- Upload your SSH public key to your GitHub account?
<path-to-your.pub>
- Title for your SSH key: GitHub CLI
- How would you like to authenticate GitHub CLI?
You are now logged in.
To switch between your accounts, use:
gh auth switch