git remote: error: hook declined to update

When submitting a project, when pushing, an error is reported:

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)

The reason is that there is a file that exceeds the limit on the file size of the git server.

Delete the local file and push it again, but still report an error. Rolled back, pushed again, still the same error.

Finally, it was found that this large file had been saved in the log, so no matter how it was deleted or modified, the same error would always be reported if the file was not removed from the log. So just delete this file in the log.

The command is as follows:

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

Then push again.

Guess you like

Origin blog.csdn.net/TiktokLiveTool/article/details/130571791