赞
踩
remote: error: GH001: Large files detected.
remote: error: Trace: 7b7de6b9372ee392e0f3961b05ea6f33
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File *.framework/Versions/A/* is 207.25 MB; this exceeds GitHub's file size limit of 100.00 MB
在使用Git时,你是否遇到过这种问题?遇到这种问题后又该如何操作呢?
1-1. 删除磁盘缓存
git rm --cached
或git rm -r --cached
1-2. 将大文件从commit记录中移除且以后commit都将不会再将其commit
git commit --amend -CHEAD
1-3. 推送至远程服务器
git push origin master
(第一次推送时命令)或git push
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)用Git内部的文本指针替换大文件,如音频样本、视频、数据集和图形,同时将文件内容存储在远程服务器上,如GitHub.com或GitHub Enterprise。
2-1. 安装,我是用的是Macbook Pro,所以选择macOS用户安装方式 Homebrew 安装
brew install git-lfs
2-2. 打开终端,cd到git仓库本地路径,初始化lfs
git lfs install
2-3. 追踪单个文件
git lfs track
eg:git lfs track "*.psd"
2-4. 添加lfs追踪文件,提交仓库(此处一定要先提交追踪文件到仓库,在提交其他文件)
git add .gitattributes
git commit -m "track *.psd files using Git LFS"
git add .
git commit -m "submit other files"
2-5. 验证是否追踪大文件,如果输入后不显示则追踪不成功
git lfs ls-files
2-6. 推送至远程仓库
git push origin master
Uploading LFS objects: 100% (1/1), 810 B, 1.2 KB/s
# ...
To https://github.com/git-lfs/git-lfs-test
67fcf6a..47b2002 master -> master
version https://git-lfs.github.com/spec/v1
oid sha256:446a6063f3b698c388700d
size 1127229450
造成此问题的原因是可能是framework文件追踪不成功导致的(我是因为这个导致的)可看Q2如何追踪framework文件。删除GitHub仓库,按照lfs方法的流程重新来一遍即可。
emote: error:
File *.framework/Versions/A/* is 207.25 MB;
this exceeds GitHub's file size limit of 100.00 MB
按照错误提示追踪framework库,因为macOS系统会将其看成一个文件夹
git lfs track "*.framework/Versions/A/*"
注意提交追踪文件后验证一下
git lfs ls-files
关注微信公众号:商丘IT圈,回复tower即可免费获取。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。