Skip to content

Instantly share code, notes, and snippets.

@endrit-b
Last active September 14, 2016 14:29
Show Gist options
  • Save endrit-b/631ec379846b2feebd280cd15c9f43a4 to your computer and use it in GitHub Desktop.
Save endrit-b/631ec379846b2feebd280cd15c9f43a4 to your computer and use it in GitHub Desktop.
Git submodule operations

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

git submodule add [email protected]: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