解决GitHub上传大于100M文件失败

问题

push的时候遇到以下问题:

remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: Trace: f5b4ccf3739dd628391d2d522f1b1baf
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File object-detection/model/resnet50_coco_best_v2.0.1.h5 is 145.59 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: File object-detection/model/yolo.h5 is 237.17 MB; this exceeds GitHub's file size limit of 100.00 MB

说的很清楚有两个文件超出了100M的限制。

解决

使用Git LFS

  1. 在官网 https://git-lfs.github.com/ 下载git-lfs-windows-v2.8.0.exe并安装。
  2. 新开一个bash命令行输入git lfs install安装
  3. 跟踪你要push的大文件git lfs track "*.h5",这时会生成一个.gitattributes文件。
  4. 这里很重要,一定要先将上一步生成的.gitattributes文件上传到仓库也就是要上传三部曲
git add .gitattributes
git commit -m "add .gitattributes"
git push origin master

这时候就可以开始上传你的大文件了。

参考

https://www.cnblogs.com/guxin/p/github-cannot-push-files-larger-than-100mb.html
https://blog.csdn.net/tyro_java/article/details/53440666

posted @ 2019-08-09 01:32  闽A2436  阅读(1403)  评论(0编辑  收藏  举报