Android Studio - Push failed: fatal: Could not read from remote repository

前端 未结 12 1129
醉酒成梦
醉酒成梦 2021-01-31 07:26

I have a git project at Android Studio and a remote at BitBucket and I changed it to use SSH instead of HTTPS. I can make everything work using Atlassian\'s SourceTree, but in A

12条回答
  •  孤城傲影
    2021-01-31 08:05

    I ran across this myself, and found the existing answers were a bit incomplete.

    tl;dr: Switching Android Studio/IntelliJ's SSH client from built-in to native may resolve the issue for you (it did for me).

    Android Studio (effectively a specialized IntelliJ IDEA) comes with its own built-in SSH client, but allows you to switch to native (platform / OS dependent) if you prefer. You can change this by opening your Android Studio options, search for 'git', and choose 'native' in the SSH executable dropdown.

    In my case, I was unable to push to BitBucket through Android Studio, but git push worked just fine. Switching to native (OSX SSH, in my case) resolved the issue - now I can push to BitBucket from Android Studio.

    Other answers touched on the subject, but there appears to have been some mixup between SSH executables and the keys that they use.

    Per Android Studio help under SSH Executable:

    • Built-in: select this option to use the implementation provided by IntelliJ IDEA.
    • Native: select this option to use native implementation.

提交回复
热议问题