如果你使用CocoaPods,你的.gitignore会怎么样? [英] What goes into your .gitignore if you're using CocoaPods?

查看:146
本文介绍了如果你使用CocoaPods,你的.gitignore会怎么样?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在已经做了几个月的iOS开发,刚刚学习了用于依赖管理的有前途的 CocoaPods 库。



我在个人项目上尝试过:为我的奇异鸟添加了一个依赖关系Podfile,运行 pod install CocoaPodsTest.xcodeproj voila ,它运行得非常好。



我唯一想知道的是:我检查了什么,以及我对版本控制忽略了什么?似乎很明显,我想检查Podfile本身,也可能检查.xcworkspace文件;但是我忽略Pods /目录?是否还有其他文件会被生成(当我添加其他依赖项时),我还应该添加到我的.gitignore中? 解决方案

就我个人而言,我不会在Pods目录&内容。我不能说我花了很长时间考虑这些影响,但我的推理如下所示:



Podfile引用每个依赖项的特定标记或提交,因此Pods它们本身可以从podfile生成,但是它们更像是一个中间构建产品而不是源,因此,不需要我的项目中的版本控制。


I've been doing iOS development for a couple of months now and just learned of the promising CocoaPods library for dependency management.

I tried it out on a personal project: added a dependency to Kiwi to my Podfile, ran pod install CocoaPodsTest.xcodeproj, and voila, it worked great.

The only thing I'm left wondering is: what do I check in, and what do I ignore for version control? It seems obvious that I want to check in the Podfile itself, and probably the .xcworkspace file as well; but do I ignore the Pods/ directory? Are there other files that will be generated down the road (when I add other dependencies) that I should also add to my .gitignore?

解决方案

Personally I do not check in the Pods directory & contents. I can't say I spent long ages considering the implications but my reasoning is something like:

The Podfile refers to a specific tag or or commit of each dependency so the Pods themselves can be generated from the podfile, ergo they are more like an intermediate build product than a source and, hence, don't need version control in my project.

这篇关于如果你使用CocoaPods,你的.gitignore会怎么样?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆