Great article. There is an alternative to creating a SSH config file. Through your terminal you can tell any github repo to point to a particular ssh key file. just set sshcommand for that repo.
git -c core.sshCommand="ssh -i private_key_file" clone host:repo.git
git config core.sshCommand 'ssh -i private_key_file'
you just made my day, thank you!
Cool! Do you know if there is a way to choose your SSH Key for use with git clone when first cloning the repo?
yes it is git clone -c core.sshCommand="ssh -i ~/.ssh/your-ssh-fileName" git@github.com:orgname/repo.git
git clone -c core.sshCommand="ssh -i ~/.ssh/your-ssh-fileName" git@github.com:orgname/repo.git
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Great article. There is an alternative to creating a SSH config file. Through your terminal you can tell any github repo to point to a particular ssh key file. just set sshcommand for that repo.
git -c core.sshCommand="ssh -i private_key_file" clone host:repo.git
git config core.sshCommand 'ssh -i private_key_file'
you just made my day, thank you!
Cool! Do you know if there is a way to choose your SSH Key for use with git clone when first cloning the repo?
yes it is
git clone -c core.sshCommand="ssh -i ~/.ssh/your-ssh-fileName" git@github.com:orgname/repo.git