swift - 如何使用 Pods 为 xcode 项目创建存储库?
问题描述
我一直在尝试将 Xcode 项目添加到 GitHub 上的存储库中,并且它可以工作,但是 pod 不在项目中并说它们丢失了。将带有 pod 的项目添加到 GitHub 的正确方法是什么?
解决方案
这取决于您的项目需求是什么。
签入 Pods 目录的好处
After cloning the repo, the project can immediately build and run, even without having CocoaPods installed on the machine. There is no need to run pod install, and no Internet connection is necessary.
The Pod artifacts (code/libraries) are always available, even if the source of a Pod (e.g. GitHub) were to go down.
The Pod artifacts are guaranteed to be identical to those in the original installation after cloning the repo.
忽略 Pods 目录的好处
The source control repo will be smaller and take up less space.
As long as the sources (e.g. GitHub) for all Pods are available, CocoaPods is generally able to recreate the same installation. (Technically there is no guarantee that running pod install will fetch and recreate identical artifacts when not using a commit SHA in the Podfile. This is especially true when using zip files in the Podfile.)
There won't be any conflicts to deal with when performing source control operations, such as merging branches with different Pod versions.
我个人在我的 .gitignore 文件中有以下内容:
# CocoaPods
#
Pods/
推荐阅读
- c++ - 2个嵌套循环的时间复杂度
- c# - 为什么不在 Json.NET 中使用 PreserveReferencesHandling?
- php - Laravel 多条件查询
- android - LiveData 的 Transformations.map 没有在单元测试中触发,并且仅在单元测试中触发
- excel - 从组合框更改文本框中的值
- mysql - 似乎无法在 Docker 容器中启动 MySQL
- sql - 查询以仅提取失败的记录
- r - R 中的 LIME 库抛出“错误:响应在排列中是恒定的。请检查您的模型”
- r - R CMD 检查未检测到我的文档
- c# - EF 6 - 使用存储过程并调用 ToListAsync()