笔者在GitHub仓库上传超过100M的video时遇到了push不了的情况,提示限制了100M,
this exceeds GitHub's file size limit of 100.00 MB
随后使用 git-lfs 解决了。 Git Large File Storage | Git Large File Storage (LFS) replaces large files such as audio samples, videos, datasets, and graphics with text pointers inside Git, while storing the file contents on a remote server like GitHub.com or GitHub Enterprise.Git Large File Storage (LFS) replaces large files such as audio samples, videos, datasets, and graphics with text pointers inside Git, while storing the file contents on a remote server like GitHub.com or GitHub Enterprise.https://git-lfs.github.com/
1、先在电脑上安装 Git Large File Storage 客户端,简称 LFS
2、然后在项目里执行 git lfs install
3、使用 git lfs track "*.mp4" 或者 git lfs track "*.pdf"等等对大于100M的文件进行索引。索引完后会在项目中生成 .gitattributes
4、然后正常的使用git命令就行。
git add .
git commit -m "fix ..."
git push
注:如果在引入lfs前,你将大于100M的文件commit了,记得把这个commit删掉,否则依然会push失败。
lfs的作用是将大文件存放到另一个仓库,然后自动给做索引映射。