Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git Submodules vs. Cocoapods [closed]

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!

like image 585
user1927638 Avatar asked May 05 '14 18:05

user1927638


People also ask

What is difference between Carthage and CocoaPods?

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.

Why Carthage over CocoaPods?

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.

What is a Git submodule?

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.

What is the difference between Git repo SCM and Git submodules?

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.

Are there any alternatives to Git submodules?

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)

What are the disadvantages of submodules in Git?

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.

How do I add a submodule to a plugin 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.


1 Answers

Git submodules shouldn't be used for dependancy management. I suggest you to use Cocoapods.

Git Submodule

Pros

  • Basically a one liner to initiate it, no need for extra files / configuration.

Cons

  • You can't specify target directories, you always have to clone the whole repository.
  • When the repository moves you have to manually update it.
  • You have to check in the actual dependancies.

Cocoapods

Pros

  • Only clones the directories you need.
  • Easy to update / maintain.
  • You doesn't have to check in the whole dependancy tree, you just need to check in the Podfile and Podfile.lock. Every maintainer can fetch the dependancies on there own.

Cons

  • Depends on the Podfile in your Spec repository or the main spec repository.
  • Depends on an external tool.

You can read more about Cocoapods here.

like image 125
Leandros Avatar answered Oct 04 '22 20:10

Leandros