
- #Git submodule point to branch how to#
- #Git submodule point to branch update#
- #Git submodule point to branch software#
- #Git submodule point to branch code#
Then there’s the Swift Package Manager, which is even newer to the scene and is stewarded by Apple through the open source community. While newer, it’s written in Swift and some find it easier to use than CocoaPods. It certainly has a large number of libraries available for use.Ĭarthage is the younger cousin to CocoaPods. There are several great tools to manage dependencies in iOS development, but it can be confusing to know which one to use.ĬocoaPods might be the most popular.
#Git submodule point to branch code#
I’m sure it wasn’t hard to convince you copy and pasting code is a terrible idea.
#Git submodule point to branch update#
When you copy and paste code, there’s no easy way to know you’re using version 1.2.2 of library XYZ, and how will you remember to update your code when version 1.2.3 is released? You’ll find this consistent in third party libraries you use in your projects.
#Git submodule point to branch software#
Proper software development practices call for versioning releases of your code.

Some third party libraries can have thousands of lines of code, spread across hundreds of files, and it’s impossible to keep things synchronized manually. When changes are made to the original code you copied, it becomes very hard to track what’s changed so you can apply those changes back to your cut and pasted code. When you copy and paste code, there’s no reference back to the original spot where the code was found, and it’s easily forgotten about. There are several problems with this approach though: Probably the most basic form of dependency management is to simply copy and paste code into your own app. It’s the practice of using configuration mechanisms to add extra code, and therefore extra features, to your software. What Is Dependency Management?ĭependency management is a concept that spans all software development disciplines, not just iOS development. Throughout the rest of this tutorial, you’ll add behavior to the app while integrating other dependencies with Git Submodules.įirst - a little bit of background on dependency management. You can try to select a photo, but the app won’t do much in response. Build and run, and you should see the following: Getting Startedĭownload the starter project for this tutorial. This will include both a private dependency for something like shared code between your own code bases, as well as a separate example where you pull in an outside third party dependency as a Git Submodule.
#Git submodule point to branch how to#
In this iOS dependency management tutorial, you’ll learn how to use Git Submodules to manage dependencies for your iOS application. Whether you want to integrate someone else’s open source project, add a library from a third party service, or even reuse code across your own projects, dependency management helps you manage these complex code relationships - and guard against some messy problems. As an iOS developer, dependency management is something you’ll eventually encounter in your coding adventures. Note:- You can perform same above steps for separate repositories as Result :- You may go one bitbucket or git server and check MainProjectBranch there you will find Submodule1Branch as submodule of MainProjectBranch.

Now Perform Submodule on this branch by given commands:.


Adding Submodule Branch(Submodule1Branch) inside MainProjectBranch In Same Repository Process :-Ĭreate Branch of Submodule(treated as Repository):-Ĭreate 1 Branch as Submodule1Branch from Master.Ĭlone Submodule1Branch in your local machine and delete everything of Master in it and push with respective Project of Submodule1Branch only by given commands:.
