Skip to content

Instantly share code, notes, and snippets.

@iannbing
Created April 22, 2019 19:44
Show Gist options
  • Save iannbing/3aa4d48cc812d8df07786c3a08fde965 to your computer and use it in GitHub Desktop.
Save iannbing/3aa4d48cc812d8df07786c3a08fde965 to your computer and use it in GitHub Desktop.
ssh config for multiple accounts
# path: ~/.ssh/config
# Work account, - the default config
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa
# Personal account
Host github.com-personal
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_personal
# When cloning a repo
# clone with the default account like you usually do
# [email protected]:iannbing/react-simple-tree-menu.git
# clone using personal account like this:
# [email protected]:iannbing/react-simple-tree-menu.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment