meta data for this page
This is an old revision of the document!
https://andrey.nering.com.br/2016/git-submodules-vs-subtrees/
submodules
Submodule is only a link to commit ref in another repo.
Add
Adding submodule:
git submodule add <repository> [<relative_local_path>]
Init
After cloning master repo with submodules:
git submodule init git submodule update
alternatively repo can be clonned with
git clone --recursive <url>
git submodule update --init --recursive git fetch --recurse-submodules
Removing submodule:
- remove entry in .gitmodules
- remove entry in .git/config
- remove dir: git rm –cached lib/lib_to_be_deleted