当上传的工程中有超过100M的文件时,直接上传github会产生如下报错:
remote: error: File retinaface-R50/R50-0000.params is 112.54 MB;
this exceeds GitHub's file size limit of 100.00 MB
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/XYZ/xxx.git'
解决方法:
安装一个Git LFS(Git Large File Storge,Git 大文件储存)
git lfs install
先把其余文件正常上传,然后跟踪超过100M的文件,
git lfs track retinaface-R50/R50-0000.params # track large file path
git add .gitattributes
git add retinaface-R50/R50-0000.params
git commit -m "submit file"
git push -u origin master
有大文件一起上传push时要先清掉大文件的push缓存:文章来源:https://www.toymoban.com/news/detail-521881.html
git filter-branch --force --index-filter "git rm --cached --ignore-unmatch retinaface-R50/R50-0000.params" --prune-empty --tag-name-filter cat -- --all
出现下面的进度条,就说明文件正在上传中啦~
文章来源地址https://www.toymoban.com/news/detail-521881.html
到了这里,关于github上传超过100M的大文件的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!