解決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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM