fatal: No url found for submodule path 'x' in .gitmodules
A submodule entry exists in the index but its URL is missing from .gitmodules.
Seen on:
Git
Meaning
Usually from deleting or renaming a submodule incompletely, or committing a nested repo folder accidentally.
Common causes
- Submodule removed from .gitmodules but still in the index
- Nested .git folder committed as a gitlink by accident
⚡ Quick fix
- Remove the stale entry: git rm --cached path
- Re-add properly: git submodule add <url> path
- Init/update: git submodule update --init --recursive
Detailed fix by platform
Git
git rm --cached vendor/lib && git commit -m "Remove broken submodule"
How to diagnose
- Index — git ls-files -s path shows mode 160000?
- Recent change — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026