hook declined to update refs/heads/dev

Submit a project, push, when given:

warning: Large files detected.
remote: error: File TaodangpuAuction/TaodangpuAuction/AuctionClasses/Discover/TXLiteAVSDK/TXLiteAVSDK_UGC.framework/TXLiteAVSDK_UGC is 120.68 MB; this exceeds file size limit of 100.0 MB
remote: error: hook declined to update refs/heads/dev
To https://gitee.com/doubleyao1116/JianHuo.git
 ! [remote rejected]   dev -> dev (hook declined)
error: failed to push some refs to 'https://gitee.com/doubleyao1116/JianHuo.git'
bogon:天天鉴定dev mac$ 

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

Delete the local file, again and again, or error. Add to ignore files, again and again is an error. Roll back, again and again, still the same error.

Finally we found the large file has been saved to log in, so no matter how deletion, the file does not have the same error will always be excluded from the log reported. So to put this in the log file can be deleted.

Command is as follows:

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

The above xxx.rar is to upload large files above

git filter-branch -f --index-filter "git rm -rf --cached --ignore-unmatch TaodangpuAuction/TaodangpuAuction/AuctionClasses/Discover/TXLiteAVSDK/TXLiteAVSDK_UGC.framework/TXLiteAVSDK_UGC" -- --all

The above process will be very long, do not worry, see the scanned files one by one fewer, that is, from the success closer.

Finally, like a git push

Guess you like

Origin www.cnblogs.com/jingxin1992/p/11024095.html