github this exceeds GitHub's file size limit of 100.00 MB错误解决方法

问题:

在GitHub上传超过100MB文件时会触发以下错误:

this exceeds GitHub's file size limit of 100.00 MB

原因:

这是GitHub官方对repo设的限制。

解决方法:

GitHub官方提供了一个叫lfs的工具来解决这个问题。解决步骤如下:

  1. 安装lfs,官方安装教程: https://github.com/git-lfs/git-lfs/wiki/Installation

这里给出ubuntu上的安装步骤

curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash

sudo apt-get install git-lfs

git lfs install

注: 其中git lfs install在要提交大文件的git工程中执行。

成功时的输出(test是一个测试工程,已经init过):

eraul@eraul:~/tmp/test$ git lfs install

Updated git hooks.

Git LFS initialized.

在工程中会多一个.gitattributes的文件夹

  1. 找到工程中的所有大文件

eraul@eraul:~/rkSource/rknn-toolkit$ find ./ -size +100M

./test/xxx1.whl

./test/xxx2.whl

./test/xxx3.whl

将这些大文件加到lfs track列表中


git lfs track ./test/xxx1.whl

git lfs track ./test/xxx2.whl

git lfs track ./test/xxx3.whl
  1. 添加这些大文件
git add .
  1. 提交
git commit -m "Add some files which size is bigger than 100.00 MB"
  1. 将提交同步到github服务器
git push
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。