Remove the files associated to the submodule

rm -rf .git/modules/path/to/sub-module-1

Remove any references to submodule in config and .gitmodules manually.

vim .git/config
vim .gitmodules

delete folder sub-module-1 folder and stage this change first

rm -rf path/to/sub-module-1
git add path/to/sub-module-1

then, you will add sub-module-1 again successfully.

git submodule add url path/to/sub-module-1
Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐