A Whirlwind Introduction to git submodules

I have put off learning how to use git submodules for too long, but one of my projects has been crying out for them for so long that I finally had to act.

The project IDZAQAudioPlayer demonstrates how to use the IDZPrecompiledOgg and IDZPrecompiledVorbis frameworks to play Ogg Vorbis audio. Before using submodules, the frameworks were manually copied into the IDZAudioPlayer/Frameworks directory and checked into the repository.

Adding Submodules

Adding submodules is relatively simple. Change to the directory where you want the submodules to reside and use git submodule add command.

You can simplify the names of the directories for the submodules. For example:

Cloning a Repository with Submodules

Cloning a repository that uses submodules requires a few extra steps. After cloning the repository.

Change into the working directory.

Then initialize and update the submodules.

About idz

A professional software engineer dabbling in iOS app development.
This entry was posted in git and tagged , . Bookmark the permalink.

Leave a Reply