Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

multiple ssh key

Next, create/edit the .ssh/config file. 

=====================================================

# Default GitHub
Host github.com
  HostName github.com
  User git
  IdentityFile ~/.ssh/id_rsa

Host github-public
  HostName github.com
  User git
  IdentityFile ~/.ssh/id_rsa_public

Host github-personal
  HostName github.com
  User git
  IdentityFile ~/.ssh/id_rsa_personal
  
=====================================================

Next, you will need to alter your .git/config remote url to point to:

git@github-personal:<gh_username>/<gh_reponame>.git

Rather than the usual:

git@github.com:<gh_username>/<gh_reponame>.git
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #multiple #ssh #key
ADD COMMENT
Topic
Name
9+6 =