ios - 为什么 Cocoapods 在推送到 Git 时会被忽略?

标签 ios xcode git cocoapods bitbucket

作为 POC,我创建了一个新的存储库(在 BitBucket 上)并尝试推送一个虚拟项目,一切正常;我尝试在具有 cocoapods 的实际项目中应用相同的确切过程,它已成功推送,但是当我尝试检查它时,我得到了没有 pod 的源代码!

我查看了 repo 的来源,它不包含 pod 目录。

以下是我尝试推送的文件(16 个文件和文件夹,192MB 大小):

enter image description here

这就是 repo 包含的内容(14 个文件和文件夹 121MB 大小):

enter image description here

请注意,我的本地计算机(Pod 和小部件)中的最后两个文件夹不在 repo 中。

没有 .gitignore 文件。

另外,我检查了:

  • git push ignore cocoapods
  • Commit to git after switching to workspace and adding CocoaPods in Xcode?

  • 没有任何有用的结果。

    任何意见,将不胜感激。

    最佳答案

    cocoa bean is a dependency manager :

    The dependencies for your projects are specified in a single text file called a Podfile. CocoaPods will resolve dependencies between libraries, fetch the resulting source code, then link it together in an Xcode workspace to build your project.



    您可以运行 pod install为您的项目安装 pod,这将创建并填充 Pods/目录。

    原因Pods/即使没有 .gitignore,目录也不在您的存储库中文件可能是它包含其他 Git 存储库(即包含自己的目录的目录 .git/ 目录)。 Git 不跟踪嵌套存储库。

    (Xcode 也有可能默认忽略该目录,但我不是 iOS 开发人员,所以我不能确定。)

    关于ios - 为什么 Cocoapods 在推送到 Git 时会被忽略?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41594914/

    相关文章:

    ios - Swift 2,无法识别的选择器发送到 UIAlertController 的实例

    ios - 长按手势识别器生成重复位置 (SWIFT)

    ios - 如何快速解析XMPPMessage中的xml?

    ios - How to Solve Compiling "_OBJC_CLASS_$_xxxx", 引用自"Issue

    ios - 重新调整布局大小后,如何将渐变层的大小放置在 UITextField 后面,匹配 UITextField 大小?

    php - 保存图像异步 CodeIgniter PHP

    iphone - XCode 4.5 Storyboard 不显示我的 View Controller 的一些导航栏

    git - 保留已删除引用的 reflog

    Git 通过哈希获取特定的提交

    git - 如何在 TFS 2012 Update 2(自托管)中启用 GIT 支持