No submodule mapping found in .gitmodules for path and missing .gitmodules file

前端 未结 4 946
野趣味
野趣味 2021-02-01 00:44

When I run git submodule init, I get the following error:

No submodule mapping found in .gitmodules for path \'xxx\'

I

相关标签:
4条回答
  • 2021-02-01 00:49

    In addition to the above I also had to remove .gitmodules.

    0 讨论(0)
  • 2021-02-01 00:51

    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.

    0 讨论(0)
  • 2021-02-01 01:04

    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.

    0 讨论(0)
  • 2021-02-01 01:10
    1. Make sure that there are no submodule sections in .git/config. If there are, remove them.
    2. Do git rm --cached <path_to_submodule>.
    0 讨论(0)
提交回复
热议问题