Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

Then our Lead changed and he said to commit the pod file to 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. Please help me clear on this thing as I went through some articles as well but didn't find any satisfactory answer.

like image 318
Sumeet Purohit Avatar asked Aug 09 '17 09:08

Sumeet Purohit


2 Answers

Whether or not you check in your Pods folder is up to you, as workflows vary from project to project. It is recommended that you keep the Pods directory under source control.

Benefits of checking in the Pods directory

  1. 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.
  2. The Pod artifacts (code/libraries) are always available, even if the source of a Pod (e.g. GitHub) were to go down.
  3. The Pod artifacts are guaranteed to be identical to those in the original installation after cloning the repo.

Benefits of ignoring the Pods directory

  1. The source control repo will be smaller and take up less space.
  2. 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.)
  3. There won't be any conflicts to deal with when performing source control operations, such as merging branches with different Pod versions.

Source: Cocoapods

like image 194
Imad Ali Avatar answered Sep 27 '22 22:09

Imad Ali


I suggest & recommend, not to commit pods directory(third party source integrated using Pod) in your Git/SVN repository.

Here is sample source, suggesting you, what to commit and not.

enter image description here

  1. Pod is a dependency manager and may have so many third party libraries in it. You project source will become heavier (large in size) and the same will get it downloaded every time a new destination uses it.
  2. You can easily integrate all Pod libraries/files source using command pod install from any source/destination.
  3. There may be different version of SDK, command line tool and cocoa pod in different systems. It automatically handles integration specific libraries supported by SDK tool & command line version, as well as cocoa pod version.

Note: It is not bad, you commit pod files with source code to 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).


Update: .xconfig files are not required to commit. PodFile is enough and required to commit.

like image 27
Krunal Avatar answered Sep 27 '22 21:09

Krunal