What are the advantages/disadvantages of using Cocoapods vs. Git Submodules? I am aware that there are several differences, but I would like to find out more about the advantages and disadvantages of using either system. Thanks!
Carthage and CocoaPods are very different in terms of building the dependencies and integrating them in the project. CocoaPods is centralized dependency manager and it will build your dependencies and integrate them directly in the project by creating new . xcworkspace workspace.
Your project builds faster in comparison to CocoaPods as Carthage only builds the frameworks once (when you call the carthage update or carthage bootstrap command). Your project remains untouched since you will only add frameworks and a new build phase.
A git submodule is a record within a host git repository that points to a specific commit in another external repository. Submodules are very static and only track specific commits. Submodules do not track git refs or branches and are not automatically updated when the host repository is updated.
As a result, a whole set of tools were created to support a code-sharing development workflow on a more modular level, aspiring to bridge the gap between the Git Repo SCM and the sub-repos within it. Git Submodules allow you to keep a Git repository as a subdirectory of another Git repository.
In mercurial, subrepositories are named “ feature of last resort ” to be avoided. In this post, we’ll suggest and review useful alternatives to Git submodules to help develop shared multiple components across projects and in a repository. Feel free to give them a try, and add your own suggestions in the comments. 1. Bit (for JS)
This is because of some major drawbacks around git submodules, such as being locked to a specific version of the outer repo, the lacking of effective merge management, and the general notion that the Git repository itself doesn’t really know it’s now a multi-module repository.
Adding a submodule Adding a submodule is still not available in the Visual Studio UI, so to add the helper repository to my solution I have to execute Git command: ? Adding the helper repository to my respository. Click image to enlarge. This adds the referenced repository to a subfolder in my plugin repository.
Git submodules shouldn't be used for dependancy management. I suggest you to use Cocoapods.
Pros
Cons
Pros
Podfile
and Podfile.lock
. Every maintainer can fetch the dependancies on there own.Cons
You can read more about Cocoapods here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With