Sébastien
Sébastien

Reputation: 5453

phpstorm looking for ssh key in wrong directory

I have started using phpSorm and git integration to commit my changes.

Everything works fine with windows cmd when running the commands. When pushing I am asked to enter ssh key for 'c/Users/safireo/.ssh/id_rsa'. Which I do and it works.

However, when trying with phpStom, I get the following error :

cannot spawn C:\Users\safireo\AppData\Local\Temp\git-ssh-0.bat: No such file or directory unable to fork

I am still able to add and commit through phpstorm and push with cmd.

The path for the ssh key seem to be different. How can I tell phpStorm to look in the right location ?

Upvotes: 1

Views: 5498

Answers (2)

Jamie G
Jamie G

Reputation: 1743

We had this problem with PhpStorm on Windows.

Everything was working from Git Bash, but not from PhpStorm.

Turns out that PhpStorm was using cmd.exe as it's terminal and Git was not working so well from cmd. To fix, we found in settings:

File > Settings > Tools > Terminal

and changed the "Shell path" to be the same as Git Bash, in our case:

"C:\Program Files (x86)\Git\bin\sh.exe" --login -i 

PhpStorm required a restart, but then all started working!

Upvotes: 3

Levon
Levon

Reputation: 91

I encountered the same problem when using git between phpStorm and Pantheon.

My solution is that phpStorm is not run as administrator..

You will see the git-ssh-0.bat file actually exists in the temp folder.

Upvotes: 1

Related Questions