背景:
如题,在Idea使用”更新项目“功能拉取gitee远程仓库代码时抛出的异常,导致无法更新代码
问题描述
报错 更新失败,/Users/xxx/.ssh/config line 1: no argument after keyword “pk\003\004\024”…(类似错误信息,省略数千字符)…/Users/xxx/.ssh/config: terminating, 653 bad configuration options Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
类似这样:
![更新失败报错截图](https://img-blog.csdnimg.cn/direct/84c592f6aecb4e06889415a0a718ae14.png)
原因分析:
经过排查,似乎是不能再使用ssh的方式作为git的地址了,得用https是的git远程仓库地址才行。
解决方案:
通过替换ssh的远程仓库地址为https的远程仓库地址即可
- 打开idea的终端,执行
git remote -v
,查看当前使用的git地址是否是以git开头,是则继续往下; - 执行
git remote remove origin
删除当前git地址; - 执行
git remote add origin https://gitee.com/xxx/xxxxxx.git
添加https格式的git地址 - 重新更新即可。可能会提示”无法更新“,下方有建议可以”选择上游分支“,点击可手动输入你需要的分支如master进行更新;如图所示:
以上,希望能对你有所帮助