简体   繁体   English

无法在 android studio 3.6 中 git push 或 pull

[英]Not able to git push or pull in android studio 3.6

I'm getting the following error while trying to push or pull or anything with ssh in android studio 3.6在 android studio 3.6 中尝试使用 ssh 推送或拉取或任何内容时出现以下错误

Update failed Invocation failed Unexpected Response from Server: Unauthorized java.lang.RuntimeException: Invocation failed Unexpected Response from Server: Unauthorized at org.jetbrains.git4idea.nativessh.GitNativeSshAskPassXmlRpcClient.handleInput(GitNativeSshAskPassXmlRpcClient.java:34) at org.jetbrains.git4idea.nativessh.GitNativeSshAskPassApp.main(GitNativeSshAskPassApp.java:30) Caused by: java.io.IOException: Unexpected Response from Server: Unauthorized at org.apache.xmlrpc.LiteXmlRpcTransport.sendRequest(LiteXmlRpcTransport.java:231) at org.apache.xmlrpc.LiteXmlRpcTransport.sendXmlRpc(LiteXmlRpcTransport.java:90) at org.apache.xmlrpc.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:72) at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:194) at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:185) at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:178) at org.jetbrains.git4idea.nativessh.GitNativeSshAskPassXmlRpcClient.handleInput(GitNat..............更新失败调用失败来自服务器的意外响应:未经授权的 java.lang.RuntimeException:来自服务器的调用失败意外响应:在 org.jetbrains.git4idea.nativessh.GitNativeSshAskPassXmlRpcClient.handleInput(GitNativeSshAskPassXmlRpcClient.java.4idea.34) 未经授权nativessh.GitNativeSshAskPassApp.main(GitNativeSshAskPassApp.java:30) 引起:java.io.IOException:来自服务器的意外响应:在 org.apache.xmlrpc.LiteXmlRpcTransport.sendRequest(LiteXmlRpcTransport.java:231) 在 orgpcr.xml 处未经授权.LiteXmlRpcTransport.sendXmlRpc(LiteXmlRpcTransport.java:90) 在 org.apache.xmlrpc.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:72) 在 org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:194) 在 org. xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:185) 在 org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:178) 在 org.jetbrains.git4idea.nativessh.GitNativeSshAskPassXmlRpcClient.handleInput....... ...... .... ....

looks like the problem is with native ssh and we cannot change it to built-in like previous versions... how to fix this ???看起来问题出在本机 ssh 上,我们不能像以前的版本一样将其更改为内置...如何解决这个问题???

any help would be appreciated任何帮助,将不胜感激

变通方法: 1. 在 Android Studio 中转到Help - Find Action - Registry... 2. 找到git.use.builtin.ssh并启用它 3. 检查 git 是否再次工作

不是直接的解决方案 - 但你可以将你的 git url 从 ssh 更改为 https,它会起作用。

git remote set-url origin YOUR_REPOSITORY_HTTPS_URL

I have found an alternative way to make SSH actually work... rate up if it worked for you!!!我找到了一种让 SSH 真正起作用的替代方法……如果它对你有用,请加分!!!

using putty plink for ssh instead of the Git ssh(openSSH)对 ssh 使用 putty plink 而不是 Git ssh(openSSH)

1.set the system env-variable GIT_SSH and let it point to plink.exe download links available here: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html 1. 设置系统环境变量 GIT_SSH 并让它指向此处提供的 plink.exe 下载链接: https ://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html

2.start pageant and add your private key to it (needs to be converted to another format to be used)(use puttygen to convert id_rsa to ppk) 2.开始选美并添加你的私钥(需要转换成其他格式才能使用)(使用puttygen将id_rsa转换为ppk)

3.use command in terminal based on github or gitlab : plink -v git@github.com or plink -v git@gitlab.com 3.在基于github或gitlab的终端中使用命令: plink -v git@github.com 或 plink -v git@gitlab.com

congrats now you can work with ssh恭喜你现在可以使用 ssh

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM