Git Submodules

Git submodules facilitate complex projects that depend on external libraries in a build system agnostic way. Practice Git submodule command usage to uncover useful methods. It’s suggested to set Git config option

git config --global submodule.recurse true

to automatically update Git submodules when running most Git commands (except git clone). An important option to avoid breaking repositories by forgetting to push changed submodules is

git config --global push.recurseSubmodules check

that will fail the push if there are changes in submodules that haven’t been pushed to their respective repositories.

2026

2025

2023

2021