Clone a git repo using a specific SSH private key

If you wish to clone a repo using a set private key, you can use the following syntax to do just that and it won’t add the private key to your usual SSH settings:

~

If you wish to clone a repo using a set private key, you can use the following syntax to do just that and it won’t add the private key to your usual SSH settings:

ssh-agent bash -c 'ssh-add private.key; git clone git@server.com:user/repo.git'

 


~

Comments