How to Remove a Git Submodule 如何快速的刪除多餘的submodule

1.編輯 .gitmodules 以刪除 LoveIt 爲例,移除

[submodule "themes/LoveIt"]
        path = themes/LoveIt
        url = https://github.com/Mr-Sheep/LoveIt

git add .gitmodules 提交更改

2.編輯.git/config,移除相應部分

  1. 移除緩存 git rm --cached themes/LoveIt

  2. 刪除文件 rm -rf .git/modules/LoveIt

  3. commit git commit -m "Removed submodule"