提交git,文件大于100M 限制的解决措施

remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.        
remote: error: Trace: a703cdcc9fade51f2a131142249cb422        
remote: error: See http://git.io/iEPt8g for more information.        
remote: error: File ARCore/Data/resources.assets.resS is 130.82 MB; this exceeds GitHub's file size limit of 100.00 MB        
remote: error: File ARCore/Libraries/libiPhone-lib.a is 463.62 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/***.git'

**上面提到Git Large File Storage(https://git-lfs.github.com/).直接访问有 github 开源的 LFS 大文件上传方法就可以解决;
具体方式下面贴出来,也给自己备注下

$ cd 项目工程文件夹
$ git lfs install
$ git lfs track "*.psd"//这里表示添加后缀为 psd 的文件,按照自己的项目替换相应的文件
$ git add .gitattributes
//好了,上面三条命令已为我们成功添加了大文件 lfs仓库; 下面是正常的git提交操作
$ git add .
$ git commit -m "添加.gitattributes文件"
$ git push origin master

备注:如果执行生面方式有失败的情况,可能是之前有提交过,清除下提交缓存

$ git rm -r --cached .

然后从新正常git提交操作


image.png
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Git 基础 基本原理 客户端并不是只提取最新版本的文件快照,而是把代码仓库完整的镜像下来。这样一来,任何一处协同...
    __silhouette阅读 15,935评论 5 147
  • Git使用教程:https://blog.csdn.net/tgbus18990140382/article/de...
    SkTj阅读 2,815评论 1 11
  • Git 命令行学习笔记 Git 基础 基本原理 客户端并不是只提取最新版本的文件快照,而是把代码仓库完整的镜像下来...
    sunnyghx阅读 3,949评论 0 11
  • 通常我们commit完成之后,往Github上push的时候,单个文件大小不会超过100M,所以基本不会遇到这种情...
    Ro_bber阅读 20,574评论 7 12
  • 媛途——人生,是一场旅途。这一程,愿以最走心的文字与你相遇。 #媛途#是一个热爱生活、热爱旅行、热爱摄影、热爱文字...
    爱笑的芦微阅读 278评论 2 0