git上传大文件错误修改方法

本文介绍了一种解决在使用Git上传超过GitHub推荐大小限制的大文件时遇到的问题的方法。通过使用git filter-branch命令,可以有效地从版本历史中移除指定的大文件。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

git上传大文件错误修改方法

错误提示
Counting objects: 15, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (13/13), done.
Writing objects: 100% (13/13), 150.22 KiB | 92 KiB/s, done.
Total 13 (delta 6), reused 0 (delta 0)
remote: warning: File data/test.xml is 64.00 MB; this is larger than GitHub's recommended maximum file size of 50 MB
remote: warning: File data/test.xml is 64.00 MB; this is larger than GitHub's recommended maximum file size of 50 MB
remote: error: GH001: Large files detected.
remote: error: Trace: e6ade98208c08b634ed28aefea36dfbb
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File data/test.xml is 128.00 MB; this exceeds GitHub's file size limit of 100 MB
To git@github.com:bobbyg603/goddard.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@github.com:xiaolin/test.git'

如果遇到这样的错误(如果大文件不需要上传到git仓库中去的话)可以这样修改,去上传已经在缓存文件中提交的这些大文件。如:

git filter-branch -f --index-filter 'git rm --cached --ignore-unmatch data/test.xml'

希望有帮助!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值