Android Studio git pull failed

Android Studio git pull failed

使用 Android Studio git 提交代码时报错,错误信息如下:

Git Pull 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... (show balloon)

我们使用 git clone 下来的项目,按理说应该可以正常使用 git 了才对呀,为什么修改完代码执行 pull 时报错呢?

我们自己搭建 git 服务器时,并没有把我们的公钥上传到 git 服务器。(像 GitHub 一样,在本地先生成一个公钥,然后将公钥粘贴到我们 GitHub 的 Settings -> SSH and GPG keys 里面)

每次下载的时候,需要输入 git 账户的密码,所以使用 AndroidStudio 默认设置就 pull 失败了。

修改 AndroidStudio 设置:
File -> Settings -> Git -> SSH executable: 由原来的 Native 修改为 Built-in 即可。

参考地址:https://stackoverflow.com/questions/55783219/how-to-fix-invocation-failed-unexpected-response-from-server-unauthorized-in-an

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值