Git提交失败【File[xxxxxx] size xxxMB, exceeds quota 100MB】

使用码云作为代码版本库,提交文件是报错:remote: error: File:xxxxx size xxxMB , exceeds 100.00 MB。
原因很明显,因为其支持的最大单个文件为100M,我上传的文件超过100M了,此时单纯remove文件是无法解决该问题的。

解决步骤

假如你的错误信息为: File 68b5d8ffdb7c7825c1a2449385efa87ec5faa3d0 size 169.453MB, exceeds quota 100MB

1.首先需要输入下面的指令找到是那个文件过大导致引发上面的报错

指令输入

bash 复制代码
git rev-list --objects --all | grep 8c4ee50e01384d54aefc272ac9ac2c29eeb36a1e

指令输出

8c4ee50e01384d54aefc272ac9ac2c29eeb36a1e 1.exe

2.根据指令输出的文件名(1.exe)填入下面的指令,并键入Git控制台
指令输入

bash 复制代码
git filter-branch -f --prune-empty --index-filter 'git rm -rf --cached --ignore-unmatch 1.exe' --tag-name-filter cat -- --all

指令输出

Rewrite 8c4ee50e01384d54aefc272ac9ac2c29eeb36a1e (58/61) (27 seconds passed, remaining 1 predicted) rm '1.exe'

3.重新进行代码提交

bash 复制代码
git push
相关推荐
维基框架21 小时前
OpenAI在给Git做优化 上游行为要变了
人工智能·git
1名持续学习的码农21 小时前
GPT Plus、GPT Pro用户第一次用Codex,项目权限和Git分支怎么设置?
人工智能·git·gpt·elasticsearch·ai编程·codex
晨曦中的暮雨1 天前
Learn Claude Code:CodeAgent 与后端程序大搭配——定时任务、Git Worktree 和MCP 服务
git·ai·llm·agent
减瓦1 天前
用 Git 为本地文件打造一台时光机
开发语言·git·编辑器
Huangjin007_1 天前
【Linux 系统篇(十一)】基础开发工具(六) —— 版本控制器 Git
linux·运维·git
影视飓风TIM2 天前
Linux下C语言缓冲区原理 + Git版本控制
linux·c语言·git
tianyuanwo2 天前
当提交标题重复阻塞CI:Git分支修复实战
git·ci/cd·分支基线调整
Salt & Light2 天前
Git 分支操作与恢复完整记录
git
重生的黑客2 天前
从远程仓库到企业级协作:Git push、pull、PR、多人开发与分支模型
git·分支·多人协作