git push时报错: hook declined to update refs/heads/detail-header

今天在git push的时候居然出现了一个自己从未见过的问题
error: hook declined to update refs/heads/detail-header

仔细阅读了下面一大段话

 C:\Users\Administrator\Desktop\travel>git push
Counting objects: 47, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (44/44), done.
Writing objects: 100% (47/47), 347.23 MiB | 1.48 MiB/s, done.
Total 47 (delta 13), reused 0 (delta 0)
remote: Powered By Gitee.com
remote: warning: Large files detected.
remote: error: File src/assets/style/img/nox_setup_v6.3.0.6_full.exe is 348.04 MB; this exceeds file
 size limit of 100.0 MB
remote: error: hook declined to update refs/heads/detail-header
To gitee.com:bangbangboom/travel.git
 ! [remote rejected] detail-header -> detail-header (hook declined)
error: failed to push some refs to '这里删掉不po出来了哈哈哈'

从里面提示的warning,error看就是有个文件台太大了啊喂

remote: warning: Large files detected.
remote: error: File src/assets/style/img/nox_setup_v6.3.0.6_full.exe is 348.04 MB; this exceeds file
 size limit of 100.0 MB

里面这个“src/assets/style/img/nox_setup_v6.3.0.6_full.exe”文件已经超过了100.0MB了。
原来码云上不允许单文件超过100m,自己在提交的时候无意中加入了一个大文件,此时因为已经git 过,也commit了,如果你只是直接删除了那个文件是不起作用的,那个大文件已经保存在log中了,因此你需要删除掉的是rm
百度了大家就是用以下命令操作的

git filter-branch -f --index-filter "git rm -rf --cached --ignore-unmatch FOLDERNAME" -- --all

把命令行里面的 FOLDERNAME 替代成你那个要删除的文件
例如我的

git filter-branch -f --index-filter "git rm -rf --cached --ignore-unmatch **src/assets/style/img/nox_setup_v6.3.0.6_full.exe** -- --all

再重新push一下
问题解决嘻嘻~

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值