300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > git push时报错: hook declined to update refs/heads/detail-header

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

时间:2020-02-29 19:14:31

相关推荐

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 pushCounting objects: 47, done.Delta compression using up to 4 pressing 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 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 filesize limit of 100.0 MBremote: error: hook declined to update refs/heads/detail-headerTo :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 filesize 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一下

问题解决嘻嘻~

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。