See documentation Git - Submodules, basic usage below.
The default git clone … is not enough, so:
git clone --recurse-submodules TARGET_REPO…or
git clone TARGET_REPO
git submodule init
git submodule updategit status
git submodules statusgit pull --recurse-submodules…you can make it default
git config submodule.recurse trueOr:
git submodule foreach git pullcd TARGET_PATH
git submodule add -b main --depth=1 TARGET_REPOgit submodule deinit -f TARGET_PATH
rm -rf .git/modules/TARGET_PATH
git rm -rf TARGET_PATH… TARGET_PATH can be found via ##Status, source: Remove A Submodule In Git | Rm -rf - Javaexercise.
… define alias in your .gitconfig:
rm-submodule = !git submodule deinit -f $1 && rm -rf .git/modules/$1 && git rm -rf $1