问题描述
我正在将用Swift编写的Xcode项目推送到GitHub.在这个项目中,我使用了适用于IOS的GoogleMaps SDK和与其他少数几个框架集成的GoogleMaps框架,这使该项目很繁重.特别是有一个名为 GoogleMaps 的文件超过100MB,这违反了GitHub的政策,因此我遇到了以下错误.
I am pushing my Xcode project which written in Swift to GitHub. In this project I used GoogleMaps SDK for IOS and GoogleMaps framework integrated with few other frameworks which made this project heavy as I expected. particularly there is one file called GoogleMaps is over 100MB which is violating GitHub's policy thus I am getting below error.
Git LFS:(0个文件,共0个,已跳过1个)0 B/0 B,已跳过34 B 对象:691,完成.
Git LFS: (0 of 0 files, 1 skipped) 0 B / 0 B, 34 B skippedCounting objects: 691, done.
最多可使用4个线程进行Delta压缩. 压缩对象:已完成100%(597/597).
Delta compression using up to 4 threads. Compressing objects: 100% (597/597), done.
书写对象:100% (691/691),60.52 MiB | 384.00 KiB/s,已完成.
Writing objects: 100% (691/691), 60.52 MiB | 384.00 KiB/s, done.
总691(delta 161),重用0(delta 0)
Total 691 (delta 161),reused 0 (delta 0)
远程:错误:GH001:检测到大文件.您可能要尝试Git 大型文件存储- https://git-lfs.github.com . 远程:错误:跟踪:a2d7f29c8861bcb6bd13498cfcd44ac3
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com. remote: error: Trace: a2d7f29c8861bcb6bd13498cfcd44ac3
远程:错误:有关更多信息,请参见 http://git.io/iEPt8g .
remote: error: See http://git.io/iEPt8g for more information.
远程:错误:文件 Pods/GoogleMaps/Frameworks/GoogleMaps.framework/Versions/A/GoogleMaps 是123.08 MB;这超出了GitHub的文件大小限制100.00 MB https://github.com/shyambhimani/FindMyBuddy.git ! [远程拒绝] master-> master(预接收钩被拒绝)
remote: error: File Pods/GoogleMaps/Frameworks/GoogleMaps.framework/Versions/A/GoogleMaps is 123.08 MB; this exceeds GitHub's file size limit of 100.00 MB To https://github.com/shyambhimani/FindMyBuddy.git ! [remote rejected] master -> master (pre-receive hook declined)
错误:无法将某些引用推送到 ' https://github.com/shyambhimani/FindMyBuddy.git '
error: failed to push some refs to 'https://github.com/shyambhimani/FindMyBuddy.git'
到目前为止,我已经尝试过
So far I have tried
Git lfs track 'Pods/GoogleMaps/Frameworks/GoogleMaps.framework/Versions/A/GoogleMaps'
git lfs track '*.*'
git lfs track '*.File'
但是没有运气,每次我按它仍然会给我同样的错误.
However no luck It still gives me same error every time I push.
我不知道该文件的扩展名,所以我尝试了*.*
,以防万一它可以工作,但是没有用.
I do not know extention of that file so I tried *.*
just in case if it works but it did not.
如果有人能帮助我解决此问题,我将不胜感激. TIA
I would be grateful if anyone could help me to solve this issue. TIA
推荐答案
除非您为Git LFS付费,否则GitHub的限制为100MB.遗憾的是,除非您使用.gitignore
忽略文件,否则无法解决此问题.但是这些文件将不再被git跟踪.
GitHub has a limit of 100MB unless you pay for Git LFS. Sadly there is no way to get around this unless you ignore files using .gitignore
. But those files will no longer be tracked by git.
编辑
忘记为您的特定情况特别是在使用通用框架(例如Google Maps)时提及它,以后使用CocoaPods重新下载它非常容易.就我个人而言,我会忽略.gitignore
中的整个文件夹,因为拉下存储库后,您始终可以轻松地重新下载它.
Forgot to mention for your specific case especially with a common framework such as Google Maps it is very easy to re download that at a later date using CocoaPods. Personally I would ignore that whole folder in .gitignore
because after you pull down your repo you can always re download it easily.
这篇关于Git推投掷错误:GH001:检测到大文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!