fatal: No submodule mapping found in .gitmodules for path Git Origin: Build & delivery OSI layer 7 · Application Last updated 25 Nov 2026

fatal: No submodule mapping found in .gitmodules for path 'lib'

The repo tracks a submodule commit but .gitmodules lacks its entry.

Exact message you may see No submodule mapping found in .gitmodules for pathfatal: No submodule mapping foundfatal: No submodule mapping found in .gitmodules for path 'lib'
Seen on: Git

Meaning

Add the entry back to .gitmodules (or remove the gitlink with git rm --cached lib). Often caused by a missing/ignored .gitmodules.

Common causes

  • .gitmodules not committed
  • Entry deleted accidentally
  • Gitlink left after removing submodule

⚡ Quick fix

  1. Restore the .gitmodules entry
  2. git rm --cached lib to drop the gitlink
  3. git submodule add URL lib

Detailed fix by platform

Git

  1. bash
    git config -f .gitmodules submodule.lib.path lib
    git config -f .gitmodules submodule.lib.url https://github.com/org/lib.git

How to diagnose

  1. .gitmodules — has path?
  2. Gitlink — in index?
  3. Intent — keep submodule?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Build & delivery. Errors that are often confused with or caused by this one (click to open):

Applying: patch failed. When you have resolved this problem, run git am --continue — Patch failed at 0001 Fix bug. hint: Use 'git am --show-current-patch' to see the failed patch (Git)Applying: patch faile…fatal: clone of 'url' into submodule path failed — fatal: clone of 'git@github.com:org/lib.git' into submodule path '/repo/lib' failed Failed to clone 'lib'. Retry scheduled (Git)fatal: clone of 'url'…fatal: remote error: upload-pack: not our ref a1b2c3d (submodule) — fatal: Fetched in submodule path 'lib', but it did not contain a1b2c3d. Direct fetching of that commit failed. (Git)fatal: remote error: …fatal: transport 'file' not allowed — fatal: transport 'file' not allowed fatal: clone of '/path/lib' into submodule path failed (Git)fatal: transport 'fil…git subtree add: prefix already exists — fatal: prefix 'vendor/lib' already exists. (Git)git subtree add: pref…GitLab CI: fatal: couldn't find remote ref / Cleaning repository — fatal: could not read Username for 'https://gitlab.example.com': No such device or address (Git)GitLab CI: fatal: cou…Submodule shows modified content / dirty submodule — modified: lib (modified content, untracked content) (Git)Submodule shows modif…submodule url — fatal: No url found for submodule path 'x' in .gitmodules (Git)submodule urlfatal: No…

Explore the map of this error Full error map →

🧠 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.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.