Following up to this question: No submodule mapping found in .gitmodule for a path that's not a submodule
If you remove a submodule from .gitmodules
, and then run git submodule update --init
, git may complain
No submodule mapping found in .gitmodules for path 'my/submodule
The generally accepted solution is to run
git rm --cached my/submodule
and afterwards run git submodule update --init
again.
What's a good way to deal with this in Continuous Integration?
I can't SSH into the CI server every time somebody remotes a submodule, and neither do I want to wipe the entire git repository.
Is there a git command with which I can git rm
all such former submodules, where I don't have to give the explicit path (e.g. my/submodule
), so that I can run every time CI runs, and have git submodule update --init
work every time?