14

I have a problem when I'm trying to clone with git on cygwin. My GIT_SSH is

 "C:\ProgramFiles(x86)\Git\bin\".

When I try to clone, here is the result:

$ git clone ssh://*****/home/local/git/prestashop myDirectory
Cloning into 'myDirectory'...
error: cannot spawn C:\ProgramFiles(x86)\Git\cmd\: No such file or directory
fatal: unable to fork

I've seen many question related to that problem but I can't find answers to solve this problem. All ideas welcome ! Thanks !

Himanshu
  • 4,327
  • 16
  • 31
  • 39
Matheus
  • 225
  • 1
  • 4
  • 8
  • 1
    Why using cygwin though? git for Windows works just fine too, and includes an openssh. – VonC May 20 '14 at 07:41

2 Answers2

21

Following Git with SSH on Windows, you see that GIT_SSH should reference the ssh executable, not just its path:

(old msysgit)
set GIT_SSH=C:\Program Files (x86)\Git\bin\ssh.exe

(new 2015 git for Windows)
set GIT_SSH=C:\Program Files\Git\usr\bin\ssh.exe
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 3
    Based on my Git for Windows install (2.5.0.windows.1), I didn't have ssh.exe at that path. I found mine at `C:\Program Files\Git\usr\bin\ssh.exe`. – Ishmael Smyrnow Oct 29 '15 at 13:58
  • @IshmaelSmyrnow Good point. i have included your comment in the answer for more visibility. – VonC Oct 29 '15 at 15:46
9

In my case, since I was using Git Extensions (3.3.1), I had adjust my SSH Client path.

Todo so, I went to Menu Tools > Settings > Git Extensions (category on left side) > SSH and adjusted my SSH Client path to C:\Program Files\git\usr\bin\SSH.EXE

Update 1

Facing this issue once again, after switching to Putty, because Pageant allows me to set my private once a day without exposing outside, where I've forgot set Putty as my ssh client, by going to Tools > Settings > Git Extensions (category on left side) > SSH > And setting Putty as my ssh client

Julio Nobre
  • 4,196
  • 3
  • 46
  • 49