https://andrey.nering.com.br/2016/git-submodules-vs-subtrees/
Submodule is only a link to commit ref in another repo.
Adding submodule:
git submodule add <repository> [<relative_local_path>]
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:
git submodule deinit lib/lib_to_be_deleted
.gitmodules.gitmodules.git/configgit rm –cached lib/lib_to_be_deletedrm -rf .git/modules/lib_to_be_deleted