gitsshphpstormtortoisegitphpstorm-2018.1

Git push does not work in PhpStorm, while in Tortoise git works just fine


I am using latest version of PhpStorm. I have a pub SSH key and private ssh key in my home directory.

Path to git executable: C:\Program Files\Git\cmd\git.exe

Now, everything works just fine, I can commit in PhpStorm. When I want Push, it writes me this error:

Push failed:

Failed with error: Could not read from remote repository.

The problem is, that I can push from Tortoise git without problem, so the Git configuration is set up in a good way.

I have found several solutions here at StackOverflow. None of them did work. I did try:

  1. Version Control -> Git -> Switch between Native / Built in SSH executable options. It did not help me.
  2. Delete .ssh file in /users/ . The PhpStorm did not create it on its own.
  3. Sync my project with Git repository.
  4. Update PhpStorm to the latest version

I did not try to turn SSH encryption into HTTP. I do not want this.

Do you have some advice, what else can be bugging me? Thank you.


Solution

  • Built-in SSH client used in IntelliJ does not support putty ssh key format. TortoiseGit is most likely configured to use putty as ssh, that is why it works.

    Does git work from the command-line, btw? If it does, and is not prompting you for a password on the command-line, you could switch PhpStorm to use Native SSH at Settings | Version Control | Git. Or configure SSH agent - https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000114504-Git-SHH-Private-Key-PAssPhrase

    You could also try converting putty ppk key to pem format.