git
submodule_error
ai_generated
true
fatal: no submodule mapping found in .gitmodules for path 'X'
ID: git/submodule-not-initialized
90%Fix Rate
90%Confidence
50Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 2 | active | — | — | — |
Root Cause
Git submodule not initialized. Common after cloning a repo with submodules.
genericWorkarounds
-
95% success Initialize and update: git submodule init && git submodule update
git submodule init && git submodule update
-
92% success Or clone with submodules included: git clone --recurse-submodules <url>
git clone --recurse-submodules
Sources: https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---recurse-submodules
-
90% success Update to latest: git submodule update --init --recursive
git submodule update --init --recursive
Dead Ends
Common approaches that don't work:
-
Delete the submodule directory and re-clone the whole repo
75% fail
git submodule init is much simpler
-
Copy the submodule code directly into the repo
70% fail
Defeats the purpose of submodules — lose upstream updates
Error Chain
Frequently confused with: