Thursday, March 26, 2015

Use specific branch/tag of submodule

To use a specific version of a submodule in your own project, first add that module to your project using the git submodule add command, then use git checkout to switch to the branch/tag that you want to use. Finally when clone your project, use git clone --recursive command

git submodule add {path_to_the_submodule}
cd submodule_directory
git checkout {branch/tag}
git commit {everything}

// this will also include all the files in the submodule
git clone --recursive {path_to_project}