What goes into your .gitignore if you're using CocoaPods?

前端 未结 19 1034
南旧
南旧 2020-11-29 14:47

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 person

19条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-29 15:11

    It depends, personally:

    Why pods should be part of the repo (under source control) and should not be ignored

    • The source is identical
    • You can build it right away as is (even without the cocoapods)
    • Even if a pod is deleted, we still have its copy (Yes, this can happen and it did. In an old project where you want just a small change you would need to implement a new library to be able to even build).
    • pods.xcodeproj settings are part of the source control as well. This means e.g. if you have the project in swift 4, but some pods must be in swift 3.2 because they are not updated yet, these settings will be saved. Otherwise the one who cloned the repo would end up with errors.
    • You can always delete pods from the project and run pod install, the opposite can not be done.
    • Even the authors of the Cocoapods recommend it.

    Some cons: larger repository, confusing diffs (mainly for team members), potentially more conflicts.

提交回复
热议问题