Interview Prep/Git & GitHub/Submodules, LFS and Hooks

After cloning, the submodule directories exist but are empty.

BeginnerTroubleshootingSubmodules, LFS and Hooks
Answer

Likely causes → A plain git clone does not fetch submodule contents; it only creates empty directories for the gitlinks.

Diagnose → git submodule status — a leading - means not initialized.

Fix →

git submodule update --init --recursive
# next time:
git clone --recurse-submodules https://github.com/org/app.git

Prevent → Set git config --global submodule.recurse true so checkout, pull and switch keep submodules in sync, and document the clone command in the README.

All Git & GitHub questions Roadmap: Git & GitHub

More on Submodules, LFS and Hooks