git与IntelliJ IDEA:无法从远程存储库读取 [英] git with IntelliJ IDEA: Could not read from remote repository

查看:1148
本文介绍了git与IntelliJ IDEA:无法从远程存储库读取的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

几周后,我无法从远程存储库中拉出或推送数据。我认为升级到IntelliJ IDEA 14时会发生这种情况,但我也可以重现IDEA 13.1.5的问题。



工具提示说
提取失败
fatal:无法从远程存储库读取。



以及版本控制标签中的异常

  14:02:37.737:cd C:\dev\project 
14:02:37.737:git -c core.quotepath = false获取原点 - 进度--prune
java.io.IOException:在RSA公钥中填充!
at com.trilead.ssh2.signature.RSASHA1Verify.decodeSSHRSAPublicKey(RSASHA1Verify.java:37)
at com.trilead.ssh2.KnownHosts.addHostkey(KnownHosts.java:98)
at com .trilead.ssh2.KnownHosts.initialize(KnownHosts.java:414)
at com.trilead.ssh2.KnownHosts.initialize(KnownHosts.java:440)
at com.trilead.ssh2.KnownHosts.addHostkeys (KnownHosts.java:137)
at org.jetbrains.git4idea.ssh.SSHMain.configureKnownHosts(SSHMain.java:462)
at org.jetbrains.git4idea.ssh.SSHMain.start(SSHMain.java :155)
at org.jetbrains.git4idea.ssh.SSHMain.main(SSHMain.java:137)
致命:无法从远程存储库读取。
请确保您具有正确的访问权限
并存在存储库。

使用IntelliJ的内置终端,执行 git -c core。 quotepath = false fetch origin --progress --prune ,它正常工作。



根据stacktrace,似乎有我的 KnownHosts 存在问题,所以我从〜/ .ssh / known_hosts 删除了我们的git服务器,希望IntelliJ能够插入它再次。但是,通过UI进行更新时,问题仍然存在,并且没有写入 known_hosts 中的新条目;考虑一些文件的缓存,我重新启动了IntelliJ,但没有成功。



当从源文件中执行另一个 git fetch 时终端,现在我被问到是否要永久添加服务器。之后,它又被写入 known_hosts ,但IntelliJ仍然不会让我更新我的项目。



我还没有发现任何有关这种行为的在线,所以我想这不是新的IntelliJ版本的已知错误。尽管如此,我已更新到14.0.2,但问题仍然存在。



IntelliJ被配置为使用内置的SSH可执行文件。



有没有人有线索可能是这里的问题?

解决方案

IntelliJ的内置SSH客户端似乎散列它 known_hosts ,但是我的主机名是明文。



当我删除该文件并让IntelliJ创建一个新的,只有我的(哈希)GitLab服务器,没有别的,它的工作。



它也不可能混合它 - 保留一些非哈希条目与IntelliJ的哈希条目。因此,您必须配置其他SSH客户端使用散列主机


Since a few weeks, I'm not able to pull or push from or to the remote repository. I thought it happend when upgrading to IntelliJ IDEA 14, but I can reproduce the problem with IDEA 13.1.5 as well.

The tooltip says "Fetch failed fatal: Could not read from remote repository."

and the exception in the Version Control tab reads

14:02:37.737: cd C:\dev\project
14:02:37.737: git -c core.quotepath=false fetch origin --progress --prune
java.io.IOException: Padding in RSA public key!
    at com.trilead.ssh2.signature.RSASHA1Verify.decodeSSHRSAPublicKey(RSASHA1Verify.java:37)
    at com.trilead.ssh2.KnownHosts.addHostkey(KnownHosts.java:98)
    at com.trilead.ssh2.KnownHosts.initialize(KnownHosts.java:414)
    at com.trilead.ssh2.KnownHosts.initialize(KnownHosts.java:440)
    at com.trilead.ssh2.KnownHosts.addHostkeys(KnownHosts.java:137)
    at org.jetbrains.git4idea.ssh.SSHMain.configureKnownHosts(SSHMain.java:462)
    at org.jetbrains.git4idea.ssh.SSHMain.start(SSHMain.java:155)
    at org.jetbrains.git4idea.ssh.SSHMain.main(SSHMain.java:137)
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

Using the built-in terminal of IntelliJ, executing git -c core.quotepath=false fetch origin --progress --prune, it works just as it should.

According to the stacktrace, there seems to be a problem with my KnownHosts, so I deleted our git server from ~/.ssh/known_hosts, hoping IntelliJ would insert it again. But the problem still appears when updating via the UI, and there is no new entry written in known_hosts; thinking about some caching of the file, I restarted IntelliJ, without success.

When doing another git fetch from the terminal, now I'm getting asked if I want to permanently add the server. After that, it has been written to known_hosts again, but IntelliJ still won't let me update my project.

I haven't found anything about this behavior online, so I guess it's not a known bug with the new IntelliJ version. Nevertheless, I updated to 14.0.2, but the problem still exists.

IntelliJ is configured to use the built-in SSH executable.

Does anybody have a clue what could be the problem here?

解决方案

IntelliJ's built-in SSH client seems to hash its known_hosts, but the one I had had its host names in clear text.

When I deleted the file and let IntelliJ create a new one, with only my (hashed) GitLab server and nothing else, it worked.

It's also not possible to mix it - keep some unhashed entries together with hashed entries for IntelliJ. So, you have to configure your other SSH clients to use hashed hosts.

这篇关于git与IntelliJ IDEA:无法从远程存储库读取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆