git2consul icon indicating copy to clipboard operation
git2consul copied to clipboard

Option that allows specifying private key for ssh connection

Open Yekut opened this issue 8 years ago • 3 comments

(This may be feature creeping) Checkout private repo with ssh:// needs private keys - however, currently it seems there's no way to tell git2consul to use which private key. Instead, the key needs to be configured globally or in ssh config. It would be nice to have the option to specify which private key to use, for example via the GIT_SSH_COMMAND environment variable that's been available since git version 2.3 - of course, this might mean support for <2.3 need to be dropped for this feature, but given 2.3 has been out for a while this might not be a significant issue.

Also - thanks, git2consul has been pretty great to use!

Yekut avatar Jan 28 '17 23:01 Yekut

Have you tried exporting GIT_SSH_COMMAND to see if it works? git commands are called by child_process.exec(), which should inherit all the parent environment variables by default.

calvn avatar Jan 29 '17 05:01 calvn

Hi, can you give me an example on how to use GIT_SSH_COMMAND with git2consul?

wkk1020 avatar Sep 27 '17 04:09 wkk1020

This is also a problem if you want to use deploy keys on Github because github only allows a deploy key to be used ONCE across all your repositories. Consequently with git2consul you can only use ONE deploy key. In short, you are forced to use a dedicated Github user for git2consul.

Be able to set which key to use on a per repo project would be great.

TomGudman avatar Oct 20 '17 05:10 TomGudman