commit submodule changes code example
Example 1: git update all submodules
git submodule update --recursive --remote
Example 2: git checkout branch and update submodules
git checkout --recurse-submodule
Example 3: Fetch submodules recursively
#! Fetch and update submodules into an existing project
git submodule update --init --recursive