解决git pull时报fatal:Could not read from remote repository错误
git pull 时报如下错误,意思是无法从远程存储库中读取。
分析原因
我试了一下git clone
和git push
都没有问题,说明 ssh 也是通的。
这个时候想想是不是路径问题。果然,因为公司要求将本地代码库地址从 https 切换到 ssh,所以问题出现在这里,路径不对。
所以修改路径即可,在当前项目中,找到 terminal,输入,git remote -v
查看目前存储的远端仓库路径;然后,使用git remote set-url origin +修改后的正确路径
。
然后,在 git pull 试一下,就可以了。
推荐阅读:Windows 如何查看 ssh 公钥?
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。
码云笔记 » 解决git pull时报fatal:Could not read from remote repository错误
码云笔记 » 解决git pull时报fatal:Could not read from remote repository错误