Answers for "multiple ssh key"

0

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:

[email protected]:<gh_username>/<gh_reponame>.git
Posted by: Guest on March-29-2022

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language