git init submodule in same repo code example Example: git checkout branch and update submodules git checkout --recurse-submodule