Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git with IntelliJ IDEA: Could not read from remote repository

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?

like image 725
stuXnet Avatar asked Dec 19 '14 13:12

stuXnet


People also ask

Could not read from remote repository in IntelliJ?

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.

How do I link my Git repository to IntelliJ?

Associate the entire project with a single Git repository Alternatively, from the main menu, select VCS | Enable Version Control Integration. Choose Git as the version control system and click OK. After VCS integration is enabled, IntelliJ IDEA will ask you whether you want to share project settings files via VCS.

How do I open a Git repository in IntelliJ?

One way to open the Git Tool window is to hover over the quick access button in the bottom left of the IntelliJ IDEA window, and select Git. This will open the Git log window. Alternatively, we can use ⌘9 on macOS, or Alt and 9, on Windows and Linux, to open the Git Tool window.

How does GitHub connect to IntelliJ repository?

Press Ctrl+Alt+S to open the IDE settings and select Version Control | GitHub. Click Add account, and in the dialog that opens, click Sign up for Github. Register your account on the Sign up for GitHub page that opens. Return to the IntelliJ IDEA settings and specify your credentials.


1 Answers

Settings --> Version Control --> Git, and then, in the SSH executable dropdown, choose Native

Version Control: Git: SSH executable: For current project

If this doesn't help, ensure that your native ssh and git clients are of a sufficiently recent version.

like image 115
yabin ya Avatar answered Sep 30 '22 01:09

yabin ya