解决克隆时报错fatal: unable to access ‘https://github.com/xxxxx/xxxx.git/‘: Recv failure: Connec

克隆远程仓库时报错信息

在本地文件夹内克隆远程仓库时报错

$ git clone https://github.com/xxxxx/xxxx.git
Cloning into '仓库名'...
fatal: unable to access 'https://github.com/xxxxx/xxxx.git/': Recv failure: Connection was reset

前情报错

  • 换了电脑用,github账号添加SSL处,有两条不同电脑信息,git与github应该绑定成功,已经通过绑定登录账号。
  • 之前克隆成功仓库,add正常,push报错。
  • 并且github加载不稳定,白天可以打开,晚上加载不出来

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

删掉本地克隆的仓库,重新克隆

克隆时报错

$ git clone https://github.com/18292872556/DailyCode.git
Cloning into 'DailyCode'...
fatal: unable to access 'https://github.com/18292872556/DailyCode.git/': Recv failure: Connection was reset

解决:

  • 检查ssl链接输入ssh
  • ssh-keygen -t rsa 输入y其他回车,覆盖ssl

在这里插入图片描述

在这里插入图片描述

  • 再次克隆,克隆成功

ssh-keygen -t rsa
在这里插入图片描述

  • 再次尝试提交代码

push出错 fatal: ‘DailyCode’ does not appear to be a git repositoryfatal: Could not read from remote repository.Please make sure you have the correct access rights and the repository exists.

报错信息

$ git push DailyCode main
fatal: 'DailyCode' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

解决:
需要检查一下git remote -v
是remote命令错了,再remove掉添加在远程的origin
git remote rm origin此时再用 git remote -v
就会发现没有origin了,再正确输入git remote add远程仓库名 https://gitee远程仓库的https.git
在这里插入图片描述

push又出错 fatal: unable to access ‘https://github.com/18292872556/DailyCode.git/’: Recv failure: Connection was reset

git push 又报了其他的错
报错信息

$ git push DailyCode main
fatal: unable to access 'https://github.com/18292872556/DailyCode.git/': Recv failure: Connection was reset

解决:

  • 依次将如下两条语句复制到git中后,回车。
git config --global --unset http.proxy
git config --global --unset https.proxy
  • 打开cmd,将ipconfig/flushdns复制,回车,清理DNS缓存
  • 再次push成功!

在这里插入图片描述
在这里插入图片描述

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值