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

Git推送大文件失败后分支落后,如何修复并提交修改?

解决GitHub大文件推送失败及分支落后问题

步骤1:处理超限制大文件

根据错误提示,scripts/format_datasets.nb.html(202.30MB)超出GitHub 100MB的文件大小限制,需二选一处理:

选项A:移除该文件(无需提交到仓库时)

  • 删除文件:rm scripts/format_datasets.nb.html
  • 暂存删除操作:git add scripts/format_datasets.nb.html

选项B:用Git LFS管理大文件(需保留该文件时)

  • 安装Git LFS后,跟踪对应文件类型:git lfs track "*.nb.html"
  • 暂存配置文件和大文件:git add .gitattributes scripts/format_datasets.nb.html

步骤2:同步远程分支

当前本地分支落后origin/main1个提交,执行变基拉取避免冗余合并提交:

git pull --rebase origin main

若拉取时出现冲突,手动解决冲突后执行git rebase --continue,直至变基完成。

步骤3:重新提交并推送

  • 提交修改:git commit -m "你的提交描述"(可复用之前的提交信息)
  • 推送到远程仓库:git push origin main

内容的提问来源于stack exchange,提问作者Aadrita Chatterjee

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.03 20:00:01