Skip to content

Instantly share code, notes, and snippets.

@endrit-b
Last active Sep 14, 2016
Embed
What would you like to do?
Git submodule operations

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

git submodule add git@github.com:blla/repo/name.git dest/dir

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

cd your_submodule
git checkout master
<hack,edit>
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 https://github.com/bllaName.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment