When I run git submodule init
, I get the following error:
No submodule mapping found in .gitmodules for path \'xxx\'
I
In addition to the above I also had to remove .gitmodules
.
just got over the same issue yesterday, after having deleted by hand the entry in .gitmodules (e.g. nano .gitmodules), I had to go with
git rm --cached <pathtomodule>
which returned a message
rm '<pathtomodule>'
then I needed a
git commit -m "delete cached modules"
and validated the submodule deletion.
Adding to the answer by @kirelagin :
Not always you need to do git rm
. Sometimes, it's merely a typo in your .gitmodules
. Here I made a few snapshots and commentaries on how SourceTree Git might lose track of submodules.
submodule
sections in .git/config
. If there are, remove them.git rm --cached <path_to_submodule>
.