[英]Should we commit pod files to version control system (GIT or SVN)
So far I was working on an app and my Team Lead said not to commit the pod files and I just followed his instructions.到目前为止,我正在开发一个应用程序,我的团队负责人说不要提交 pod 文件,我只是按照他的指示去做。
Then our Lead changed and he said to commit the pod file to Git.然后我们的 Lead 发生了变化,他说要将 pod 文件提交到 Git。 So I was confused which one to go with.所以我很困惑应该选择哪一个。
Should we commit the pod file or not and if we should not then why.我们是否应该提交 pod 文件,如果我们不应该提交,那么为什么。 Please help me clear on this thing as I went through some articles as well but didn't find any satisfactory answer.请帮我弄清楚这件事,因为我也浏览了一些文章,但没有找到任何令人满意的答案。
Whether or not you check in your Pods folder is up to you, as workflows vary from project to project.是否签入 Pods 文件夹取决于您,因为工作流程因项目而异。 It is recommended that you keep the Pods directory under source control.建议您将 Pods 目录置于源代码控制之下。
Benefits of checking in the Pods directory签入 Pods 目录的好处
Benefits of ignoring the Pods directory忽略 Pods 目录的好处
I suggest & recommend, not to commit pods directory(third party source integrated using Pod) in your Git/SVN repository.我建议并推荐,不要在您的 Git/SVN 存储库中提交 pods 目录(使用 Pod 集成的第三方源)。
Here is sample source, suggesting you, what to commit and not.这是示例源,建议您提交什么,不提交什么。
pod install
from any source/destination.您可以使用来自任何源/目标的命令pod install
轻松集成所有 Pod 库/文件源。 Note: It is not bad, you commit pod files with source code to Git/SVN.注意:这还不错,您将带有源代码的 pod 文件提交到 Git/SVN。 But also, that's not good to add dependencies (of third party library) with your code, which is not required and easy to handle using pod
on different destinations (systems).但是,在您的代码中添加依赖项(第三方库的)也不好,这不是必需的,并且在不同的目标(系统)上使用pod
很容易处理。
Update: .xconfig files are not required to commit.更新:不需要提交 .xconfig 文件。 PodFile is enough and required to commit. PodFile 就足够了,并且需要提交。
If you are using local development pods
, there is an annoying issue if you don't commit the Pods repo.如果您使用的是local development pods
,如果您不提交 Pods 存储库,则会出现一个烦人的问题。
Assume you are working on a branch and added file X to a local development Pod.假设您正在一个分支上工作并将文件 X 添加到本地开发 Pod。 So it's added in 'Compile Sources' in the development Pod target of Pods.xcodeproj
file.所以它被添加到Pods.xcodeproj
文件的开发 Pod 目标中的“编译源”中。
Now you switch branch to another commit which doesn't have file X. Since you gitignore the Pods.xcodeproj
, the file X remains in 'Compile Sources' and causes build to fail.现在您将分支切换到另一个没有文件 X 的提交。由于您 gitignore Pods.xcodeproj
,文件 X 保留在“编译源”中并导致构建失败。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.