Skip to content

Instantly share code, notes, and snippets.

@lucasdavila
Created April 4, 2019 18:25
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 lucasdavila/1471b621762554835b78c48b4d480990 to your computer and use it in GitHub Desktop.
Save lucasdavila/1471b621762554835b78c48b4d480990 to your computer and use it in GitHub Desktop.
Using multiple ssh keys with git
# This gist will help you using multiple github or bitbucket accounts in the same machine.
# 1. create a .ssh/config file, with this content:
# use "bitbucket-ieducativa" as git remote host, to use this custom key
Host bitbucket-ieducativa
HostName bitbucket.org
User git
IdentityFile ~/.ssh/bitbucket-ieducativa
IdentitiesOnly yes
# default key
Host bitbucket.org
User git
IdentityFile ~/.ssh/m4u
IdentitiesOnly yes
# 2. make sure the identity files exists (by creating ssk keys).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment