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

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

问题描述

几周以来,我无法从远程存储库拉取或推送到远程存储库.我以为升级到 IntelliJ IDEA 14 时会发生这种情况,但我也可以使用 IDEA 13.1.5 重现该问题.

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:devproject
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.

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

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

根据stacktrace,我的KnownHosts似乎有问题,所以我从~/.ssh/known_hosts中删除了我们的git服务器,希望IntelliJ能插入再说一遍.但是通过UI更新还是出现这个问题,而且known_hosts里面没有写新的条目;考虑对文件进行一些缓存,我重新启动了 IntelliJ,但没有成功.

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.

当从终端执行另一个 git fetch 时,现在有人问我是否要永久添加服务器.之后,它再次写入known_hosts,但IntelliJ 仍然不让我更新我的项目.

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.

我没有在网上找到任何关于这种行为的信息,所以我猜这不是新 IntelliJ 版本的已知错误.尽管如此,我更新到14.0.2,但问题仍然存在.

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 配置为使用内置的 SSH 可执行文件.

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

有人知道这里可能是什么问题吗?

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

推荐答案

IntelliJ 的内置 SSH 客户端似乎散列它的known_hosts,但我有一个明文的主机名.

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

当我删除文件并让 IntelliJ 创建一个新文件时,只有我的(散列的)GitLab 服务器,没有其他东西,它起作用了.

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

也不可能混合使用 - 将一些未散列的条目与 IntelliJ 的散列条目保存在一起.因此,您必须配置其他 SSH 客户端使用散列主机.

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.

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

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