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

Remove

Removing submodule: