Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git on Windows: Force use of OpenSSH [closed]

Tags:

git

windows

I installed git for windows and when presented with the option to pick Putty or OpenSSH, I opted for OpenSSH. However, I do have putty installed, and it appears that git caught on to this and is trying to use it. (I have GIT_TRACE=2 in the environment variables)

E:\blah>git push
trace: built-in: git 'push'
trace: run_command: 'ssh' '[email protected]' 'git-receive-pack '...
Enter passphrase for key 'C:\putty\my.ppk':

Which is really weird cause that ppk doesn't even have a passphrase. Though the real issue is that it shouldn't be using the putty key, it should be using ~/.id_rsa

This was working right after install, but after restarting the computer it started doing this.

Is there a way I tell git to use openssh without having to reinstall it?

like image 509
leech Avatar asked Oct 23 '13 02:10

leech


1 Answers

it appears that git caught on to this

Maybe because putty.exe is coming first in your %PATH%.

Check your GIT_SSH environment variable.

set GIT_SSH

If you want to use openssh, you need to set it to git/bin/ssh.exe:

set GIT_SSH=C:\path\to\git\bin\ssh.exe

That should ensure that the push and pull commands look for ~/id_rsa(.pub) keys instead of asking for a putty *.ppk private key store.

like image 171
VonC Avatar answered Nov 14 '22 13:11

VonC