Skip to content

Instantly share code, notes, and snippets.

@gbhasha
Created September 12, 2017 06:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gbhasha/865f753dcfd54543ca25a4c012989812 to your computer and use it in GitHub Desktop.
Save gbhasha/865f753dcfd54543ca25a4c012989812 to your computer and use it in GitHub Desktop.
Load ssh keys based on the GitHub host
# Put below code in ~/.ssh/config
# Default GitHub
Host github.com
ForwardAgent yes
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa
# private GitHub
Host github.orgname.com
HostName github.orgname.com
User git
IdentityFile ~/.ssh/id_rsa_something
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment