Skip to content

Instantly share code, notes, and snippets.

@zhooravell
Last active April 22, 2020 13:37
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 zhooravell/a97fe1244182ecaa3a48d143288e97f7 to your computer and use it in GitHub Desktop.
Save zhooravell/a97fe1244182ecaa3a48d143288e97f7 to your computer and use it in GitHub Desktop.
How to specify the private SSH-key to use when clone git repository?
GIT_SSH_COMMAND='ssh -i ~/.ssh/id_rsa_work' git clone git@github.com:golang/go.git
nano go/.git/config
[core]
...
sshCommand = ssh -i /home/user/.ssh/id_rsa_work -F /dev/null
[user]
name = Roman Zhuravel
email = zhooravell@gmail.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment