版权声明:本文为他叫自己Mr.张的原创文章,转载请注明出处,否则禁止转载。 https://cloud.tencent.com/developer/article/1452959
使用 IDEA 或者 Android Studio 时,使用界面进行 git push 代码时如果出现此异常,可以使用下面的方式解决:
异常完整日志:
java.io.IOException: Authentication failed:
at org.jetbrains.git4idea.ssh.SSHMain.authenticate(SSHMain.java:298)
at org.jetbrains.git4idea.ssh.SSHMain.start(SSHMain.java:172)
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.
解决方案:
Prefrences > Version Control > Git > SSH executable:选择 Native
默认是 Built-in ,它使用编辑器自带的 git,无法正常访问到我们在电脑上设置的密钥等配置,不能正常使用密钥方式无密码提交代码。