Skip to content

Instantly share code, notes, and snippets.

Last active Sep 14, 2016
What would you like to do?
Git submodule operations

To manually add a repo as a gitsubmodule, run this:

git submodule add dest/dir

To commit and push from a master module and its submodules, run followings:

cd your_submodule
git checkout master
git commit -a -m "commit in submodule"
git push
cd ..
git add your_submodule
git commit -m "Updated submodule"

To clone the entire project together with submodules, run this:

git clone --recursive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment