git with IntelliJ IDEA: Could not read from remote repository

前端 未结 30 1993
夕颜
夕颜 2020-12-07 08:11

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 w

相关标签:
30条回答
  • 2020-12-07 08:30

    I solved this issue by re-adding remote repository: VCS -> Git -> Remotes.

    0 讨论(0)
  • 2020-12-07 08:31

    I started getting Could not read from remote repository error recently when working with my github repository. My specs:

    • IntelliJ IDEA 2017.3.4 (Ultimate Edition)
    • Settings -> Version Control -> Git -> SSH executable -> Built-In
    • Fedora Linux

    Of course those problems occurred only when trying to push/pull/fetch etc. from IDE - executing same commands from command line worked like a charm.

    Solution that worked for me

    I didn't want to switch from Built-In SSH executable to Native, mostly because my native SSH client asks me for the password anytime I try to sync with remote repository.

    I solved this problem by switching from SSH remote URL to HTTPS URL. According to this GitHub help page - it is recommended to use HTTPS URL instead of SSH one.

    Changing remote URL from SSH to HTTPS

    In IntelliJ IDEA go to VCS -> Git -> Remotes..., select row containing "origin" and click on edit button. If you host your repository on GitHub, replace your SSH URL from:

    git@github.com:USERNAME/REPOSITORY.git
    

    to:

    https://github.com/USERNAME/REPOSITORY.git
    

    You can also get your HTTPS URL from your GitHub repository home page - click on "Clone or download" button and click on "Use HTTPS" link to display your repository's HTTPS URL:

    UPDATE 2018-03-13

    JetBrains just released IntelliJ IDEA 2017.3.5 that includes fix for SSH access to GitHub - https://blog.jetbrains.com/idea/2018/03/intellij-idea-2017-3-5-fix-for-ssh-access-to-github/

    0 讨论(0)
  • 2020-12-07 08:32

    We've recently updated from IntelliJ 12 to IntelliJ 14 Ultimate and we've encountered this problem too. Our solution was to disable the proxy in the settings. We also stopped remembering the passwords once, but might not sure if that helps. Proxy settings are under File-Settings-Apearance & Behavior-System settings-HTTP Proxy.

    0 讨论(0)
  • 2020-12-07 08:33

    Adding this answer since none of the answers worked for me.

    I had certificates issue - so following command did the trick.

    git config --global http.sslVerify false

    taken from https://confluence.atlassian.com/fishkb/unable-to-clone-git-repository-due-to-self-signed-certificate-376838977.html

    0 讨论(0)
  • 2020-12-07 08:36

    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.

    0 讨论(0)
  • 2020-12-07 08:36

    This fixed it for me (I am using SSH, not HTTPS, and the native git, not the built-in) on MacOS High Sierra (10.13.5)/IntelliJ IDEA 2018.4:

    0 讨论(0)
提交回复
热议问题