submodule url 🌿 Git

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

  1. Remove the stale entry: git rm --cached path
  2. Re-add properly: git submodule add <url> path
  3. Init/update: git submodule update --init --recursive

Detailed fix by platform

Git

  1. git rm --cached vendor/lib && git commit -m "Remove broken submodule"

How to diagnose

  1. Index — git ls-files -s path shows mode 160000?
  2. 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.