zoukankan      html  css  js  c++  java
  • git remote: error: hook declined to update

    提交一个项目,push的时候,报错:

    remote: error: File xxx.rar is 102 MB; this exceeds Git@OSC's file size limit of 100 MB
    remote: error: hook declined to update refs/heads/master
    
    ……
    
    ! [remote rejected] master -> master (hook declined)

    原因是有一个文件超过了git服务器对文件大小的限制。

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

    最后发现是这个大文件已经保存到了log中,因此无论怎么删改,这个文件没有从log中剔除就总会报出相同的错误。所以要在日志中把这个文件删除即可。

    命令如下:

    git filter-branch -f --index-filter "git rm -rf --cached --ignore-unmatch xxx.rar" -- --all

    然后再Push即可。

  • 相关阅读:
    单调栈
    单调队列
    线段树
    树状数组
    KMP模式匹配
    二分图最大匹配
    celery发送短信接口
    celery配置与基本使用
    celery介绍
    短信验证接口
  • 原文地址:https://www.cnblogs.com/lurenjiashuo/p/git-remote-error-hook-declined-to-update.html
Copyright © 2011-2022 走看看