Intellij unable to fetch from git

I've cloned an existing git repository. Git is working fine when I pull using command line. However, when I try doing the same from Intellij, it says

Fetch failed. Fatal : Could not read from remote repository.

VCS console log shows:

git fetch --progress --prune origin
java.lang.RuntimeException: Invocation failed Server returned invalid Response.
    at org.jetbrains.git4idea.ssh.GitSSHXmlRpcClient.askPassword(GitSSHXmlRpcClient.java:176)
    at org.jetbrains.git4idea.ssh.SSHMain.authenticate(SSHMain.java:265)
    at org.jetbrains.git4idea.ssh.SSHMain.start(SSHMain.java:157)
    at org.jetbrains.git4idea.ssh.SSHMain.main(SSHMain.java:137)
Caused by: java.io.IOException: Server returned invalid Response.
    at org.apache.xmlrpc.LiteXmlRpcTransport.sendRequest(LiteXmlRpcTransport.java:243)
    at org.apache.xmlrpc.LiteXmlRpcTransport.sendXmlRpc(LiteXmlRpcTransport.java:90)
    at org.apache.xmlrpc.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:72)
    at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:194)
    at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:185)
    at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:178)
    at org.jetbrains.git4idea.ssh.GitSSHXmlRpcClient.askPassword(GitSSHXmlRpcClient.java:170)
    ... 3 more
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

I'm using ssh key pair for authentication. I'd appreciate any help on this.


Solution 1:

For IntelliJ 13/14,

  1. Click File-> Settings. Keyboard shortcut is Ctrl+Alt+S.
  2. Search for "Version Control"
  3. Choose "Git" under "version Control"
  4. In the SSH executable dropdown, choose Native