Git: Fix error "default: No submodule mapping found"

Submitted by Peter Majmesku on Tue, 12/12/2017 - 14:26

This error comes up, if you build your project with Composer and you have added un-registered Git submodules (in file .gitmodules) via a Git commit. A possible solution.

Firstly de-init all Git Submodules: 

git submodule deinit --all

Then remove the specific Git submodule "entirely" (uncommited data, commited data and the folder itself):

git rm -rf --cached <path-to-missing-module>
git rm <path-to-missing-module>
rm <path-to-missing-module>

Now you can run your packaging/build process with e.g. Composer or Vagrant again. You should get this success message:

Cleared directory 'my/path'

Alternatively you can edit the .gitmodules file to register the Git submodules.

Tags