今天git提交同步失败,报错如下

remote: error: File app/class_files.txt is 146.18 MB; this exceeds file size limit of 100.0 MB
remote: error: hook declined to update refs/heads/dev

! [remote rejected] dev -> dev (hook declined)

原来编译项目后无意中多了个文件class_files.txt,文件太大,超过git限制。

删掉本地文件,再推,还是报错。回滚,再推,还是同样的错误。

因为这个大文件在记录中已经存在,因此无论怎么删改,都不行的,所以要在日志中把这个文件删除即可。

网上搜到的有这样的命令

git filter-branch -f --prune-empty --index-filter ‘git rm -rf --cached --ignore-unmatch文件名’ --tag-name-filter cat – --all

我执行后是有问题的,报了这样一个问题

fatal: bad revision ‘rm’

后来又查找到一个命令

git filter-branch -f --index-filter “git rm -rf --cached --ignore-unmatch 文件名” – --all

执行后再push成功了

完成的解决步骤如下:
1、先执行

git ls-files

查看错误文件的完整路径
2、再执行下面的命令

git filter-branch -f --index-filter “git rm -rf --cached --ignore-unmatch app/class_files.txt” – --all

然后再Push即可。

git remote: error: hook declined to update相关推荐

  1. git错误:exceeds file size limit of 100.0 MB remote: error: hook declined to update refs/heads/master

    今天在git上提交了一个大于100M的文件,结果发现报错如下: remote: warning: Large files detected. remote: error: File a/b/c is ...

  2. 【Git】Git commit至Gitee报错‘remote: error: hook declined to update refs/heads/master‘的解决方法

    Git commit至Gitee报错'remote: error: hook declined to update refs/heads/master'的解决方法 进入到Gitee的邮箱管理中,取消勾 ...

  3. 阿里云代码超限2040M remote: error: hook declined to update refs/heads

    1 修改配置文件法 remote: error: hook declined to update refs/heads https://www.cnblogs.com/lanrumeng/p/1231 ...

  4. Git commit至Gitee报错‘remote: error: hook declined to update refs/heads/master‘的解决方法

    进入到Gitee的邮箱管理中,取消勾选禁止命令行推送暴露个人邮箱

  5. Git remote: error: this exceeds file size limit of 100.0 MB

    主要是针对新手会出现的问题,我第一次用GitHub上传代码时,因为个别文件较大所以就报了以上错误,在本地删除之后,仍然会报相同错误,说明已经存到git某缓存区了,可以如下操作来修改: 比如我之前删除的 ...

  6. 解决git报错[remote rejected] HEAD -> master (pre-receive hook declined) error: failed to push some...

    git push 报错 ...[remote rejected] HEAD -> master (pre-receive hook declined) error: failed to push ...

  7. it : Tmaster (hook declined) error: failed to push some refs to https://xxx/biluo/xxx.git

    To https:///biluo/xxx.git! [remote rejected] master -> master (hook declined) error: failed to pu ...

  8. IDEA输入命令git push origin master报错: ! [remote rejected] master - master (hook declined)

    IDEA输入命令git push origin master报错: ! [remote rejected] master -> master (hook declined) error: fai ...

  9. git push报错:remote: error: refusing to update checked out branch: refs/heads/master

    远程仓库通过git init初始化了一个项目,没有clone到本地,本地新建了一个项目,关联本地项目和远程仓库(参见IDEA新建本地项目关联远程git仓库 )后git push报错: wulf@wul ...

  10. Git报错解决:remote: error: File:1f6cc8452313 157.10 MB, exceeds 100.00 MB

    完整报错 $ git push origin master Enumerating objects: 25, done. Counting objects: 100% (25/25), done. D ...

最新文章

  1. (JavaWeb)JSP,JSTL
  2. Android秒级编译方案-FreeLine
  3. python元编程之使用动态属性实现定制类--特殊方法__setattr__,__getattribute__篇
  4. 获取手机信息(UIDevice、NSBundle、NSLocale)
  5. python原理及代码_原理+代码|详解层次聚类及Python实现
  6. Codeforces Round #735 (Div. 2)
  7. 产业数字化升级进入深化期,腾讯智慧出行释放“数字底座”核心能力
  8. Linux内核解读入门(转CSDN)
  9. matlab激活中遇到 matlab2017a license error -8,523错误
  10. 一个在华为工作十年的大牛 历程
  11. 收费系统对接微信公账号流程
  12. 21年6月阿里巴巴Java暑期实习面经回顾(已上岸)
  13. 通用电源模块的测试方法及性能指标
  14. 理财笔记 - 关于沪深300指数基金
  15. python爬取酷狗音乐top500及歌词_爬取酷狗音乐Top500(示例代码)
  16. android锁屏原理(一)
  17. Oracle聚簇因子(Clustering factor,CF)
  18. 英语四六级翻译5:红包
  19. Android友盟统计和埋点
  20. 在PB中如何打开一个非執行文件

热门文章

  1. C++ 多线程CreateThread LPVOIDlpParameter传递多个参数
  2. 简易地图(MKMapView,CLLocationManagerDelegate,CLGeocoder)
  3. 前端工程师是什么?前端工程师工资怎么样?有没有前景
  4. 机器学习7个主要领域
  5. word排版快捷指令_Word怎么快速排版?这12招Word排版小技巧,3分钟完成一个Word文档...
  6. 摄影基础知识——光学变焦和数码变焦
  7. 2021认证杯 第二阶段 思路加代码
  8. C语言 哲学家就餐问题
  9. python中求根公式_python求根公式
  10. 新昌中学2021高考成绩查询,新昌中学教育集团向2020年参加高考被第一批录取的553名学子表示热烈祝贺...