shugigo
shugigo

Reputation: 163

How to Figure Which SSH Client is Used by Git in Git Bash on Windows

I want to figure which SSH client is used by git commands when running git bash on windows. Is there any git command I can run that will display the ssh client path?

Upvotes: 8

Views: 3842

Answers (1)

VonC
VonC

Reputation: 1323753

With a recent enough git version, you can use trace2 to display what Git is trying to do:

GIT_TRACE2=1 git clone [email protected]:<me>/<myrepo>
GIT_TRACE2_EVENT=1 git clone [email protected]:<me>/<myrepo>

You can also set the GIT_SSH_COMMAND environment variable to ssh (including its full path) if you want to make sure which SSH client is used.


Jacob Stamm adds in the comments, to illustrate that approach:

I was working in a Docker container from Windows, and from within the container, Git was trying to use C:\Windows\System32\OpenSSH\ssh.exe for SSH and failing.

Setting ENV GIT_SSH_COMMAND /usr/bin/ssh in my Dockerfile and rebuilding my container solved the issue. T

Upvotes: 4

Related Questions