Interview Prep/Git & GitHub/Hooks, submodules, LFS and signing

Why do submodules confuse people and what are the common pitfalls?

IntermediateConceptHooks, submodules, LFS and signing
Answer

The parent tracks a commit, not a branch, so after git pull the submodule stays at the old commit until git submodule update. Commits made inside the submodule must be pushed first, otherwise the parent references a SHA nobody else can fetch. Detached HEAD in submodules is the default.

git config submodule.recurse true
git push --recurse-submodules=check
All Git & GitHub questions Roadmap: Git & GitHub

More on Hooks, submodules, LFS and signing