AndroidStudio git拉代码报错Unexpected end of file from server

git console 日志错误信息:
Invocation failed Unexpected end of file from server
java.lang.RuntimeException: Invocation failed Unexpected end of file from server
error: unable to read askpass response from 'C:\Users\navinfo\AppData\Local\Google\AndroidStudio2021.2\tmp\intellij-git-askpass-local.sh'

问题原因:
AndroidStudio git账户密码认证框弹不出来, 需要自己修改git地址, 在地址中包含用户名密码.

解决方案1:
工具栏->git->manage remotes
修改git地址, 插入用户名密码
原地址:https://git.你的git仓库地址.git
修改后:https://username:password@git.你的git仓库地址.git

image.png

解决方案2:
打开电脑中的gitbase命令窗口
输入命令cd到项目本地目录(注意修改斜杠\为反斜杠/)
cd D:AndroidProject/mediacontrolservice 输入命令vim .git/config vim .git/config
输入字母"i"进入编辑模式, 编辑git地址中插入username:password@
输入字母"ZZ"保存并退出即可

image.png

gitbase命令参考:
https://blog.csdn.net/qianggezhishen/article/details/50728915

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容