Git error: Cannot Spawn ~\.ssh

Go To


I created a repo on GitHub, and wanted to push local a local repo as I have done in the past. I can ssh -T successfully, but git push -u origin master gives me the error:

error: cannot spawn C:\Users\Alec\.ssh: No such file or directory
fatal: unable to fork

My GIT_SSH variable is C:\Users\Alec\.ssh and in that directory I have my RSA keys. I even tried generating a new key and using that one, just to receive a the same error.

All of my local repos now show this error - I'm not sure what's gone wrong.

Edit: Not that I think it matters, but I get the same issue whether I use the Command Prompt or Git Bash.

2012-04-04 16:35
by Alec


GIT_SSH is supposed to point to the ssh client (ssh.exe in your case), not the .ssh folder.

2012-04-04 16:39
by ThiefMaster
Thanks, I had installed Putty for a seperate purpose and I am guessing that overwrote my variable? I hadn't changed it myself - Alec 2012-04-04 16:44
does it done for you - Mathew P. Jones 2013-12-13 14:45


I've got the same problem with you. and all what i do is to shut down my comodo firewall, and that really works. so i suggest you close your firewall and antivirus software. Good luckl.

2012-06-11 15:06
by lichenbo


I had the same problem as well. I thought is was something with the firewall as well, but I ended up re-installing Git on my PC and then it suddenly worked like a charm.

2014-09-12 00:36
by Cfrim