Git提交错误:检测到大文件

4

你好,我正在开发一个针对iOS 8.1的应用程序,使用了GoogleMaps框架来实现自动完成功能。当我尝试将我的项目推送到Git时,出现了大文件检测错误。后来我尝试使用git lfs,并跟踪了Git检测到的文件(即GoogleMaps),但仍然无法成功推送。

iSpire-Solution-1:productionPreFinal 2$ git push -u origin master
Counting objects: 762, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (693/693), done.
Writing objects: 100% (762/762), 83.82 MiB | 4.14 MiB/s, done.
Total 762 (delta 179), reused 0 (delta 0)
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: Trace: e7a6ab16d31c340cad67b08ee53ee032
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File Pods/GoogleMaps/Frameworks/GoogleMaps.framework/Versions/A/GoogleMaps is 113.56 MB; this exceeds GitHub's file size limit of 100.00 MB
To https://github.com/ispire123/AutoM8.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/ispire123/AutoM8.git'
iSpire-Solution-1:productionPreFinal 2$ git lfs track
Listing tracked paths
    Pods/GoogleMaps/Frameworks/GoogleMaps.framework/Versions/A/GoogleMaps (.gitattributes)

请告诉我如何管理git lfs,并且有没有选项可以减小iOS中GoogleMaps框架的文件大小。
谢谢。

我认为这只是使用GitHub的限制,也许高级账户可以解除此限制,但我只是猜测而已。 - Fonix
如果框架是一个pod,你可以潜在地将它git-ignore,以便不会被提交,当项目被检出时,只需要重新安装该pod即可。 - Fonix
你的文件大小是多少? - Badal Shah
谢谢,我认为对于我的情况,使用git-ignore可能是更好的选择。 - Joydeep Sarkar
因为我已经使用付费账户。 - Joydeep Sarkar
巴达尔·沙阿:这是113.56 MB。 - Joydeep Sarkar
1个回答

1
假设您正在使用CocoaPods作为Xcode项目的依赖管理器, 请考虑遵循这些建议,仅将Podfile提交到版本库中,因为可以从Podfile重新生成pods。
这意味着您不会超过Github文件限制,并且保持了您的存储库简化。
为确保不将任何Pods提交到您的存储库中,请将pods/目录添加到您的/a .gitignore文件中。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接