You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

执行git push -u origin main时遇Recv failure: Connection was reset错误求助

Git Push连接重置错误的解决方法

执行git push -u origin main时出现如下错误:

fatal: unable to access 'https://github.com/Khadija-Emran/BenEmran.git/': Recv failure: Connection was reset

以下是经过验证的可行解决步骤:

  • 切换为SSH协议推送

    1. 生成SSH密钥(无密钥时执行):ssh-keygen -t ed25519 -C "你的邮箱地址",全程按回车使用默认配置
    2. 复制~/.ssh/id_ed25519.pub文件内的全部内容,添加到GitHub账户的SSH密钥设置中
    3. 修改本地仓库远程地址:git remote set-url origin git@github.com:Khadija-Emran/BenEmran.git
    4. 重新执行推送命令:git push -u origin main
  • 检查并清理Git代理配置

    1. 查看当前代理设置:git config --global --get http.proxy、git config --global --get https.proxy
    2. 若存在无效代理,清空配置:git config --global --unset http.proxy、git config --global --unset https.proxy
    3. 如需使用代理,设置正确的代理地址(示例):git config --global https.proxy http://127.0.0.1:1080(替换端口为你的代理实际端口)
  • 重置本地网络与DNS

    1. 在Git Bash中执行:ipconfig /flushdns(Windows系统)
    2. 重启路由器或本地网卡,等待网络恢复后重试推送
  • 确认GitHub服务状态
    前往GitHub官网底部的「Status」入口,查看GitHub服务器是否正常运行,若有服务故障需等待官方修复

内容的提问来源于stack exchange,提问作者khadija emran

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.13 22:47:08