我已经克隆了一个现有的 git 存储库。当我使用命令行拉取时,Git 工作正常。但是,当我尝试从 Intellij 执行相同操作时,它显示
Fetch failed. Fatal : Could not read from remote repository.
VCS 控制台日志显示:
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.
我正在使用 ssh 密钥对进行身份验证。我很感激任何帮助。
答案1
对于 IntelliJ 13/14,
- 点击文件->设置。键盘快捷键是Ctrl+ Alt+ S。
- 搜索“版本控制”
- 在“版本控制”下选择“Git”
- 在 SSH 可执行文件下拉菜单中,选择 Native