我有一个关于删除 git 子模块的问题。我正在使用 git 组织我的配置文件和 vim 包,并将 vim 包作为子模块。现在我正在尝试删除一个子模块(根据说明 here ,但我没有成功。
--git submodule deinit -f vim/bundle/snipmate-snippets
Submodule work tree 'vim/bundle/snipmate-snippets' contains a .git directory
(use 'rm -rf' if you really want to remove it including all of its history)
所以我尝试 rm -rf
...
--git rm -rf vim/bundle/snipmate-snippets
error: the following submodule (or one of its nested submodules)
uses a .git directory:
vim/bundle/snipmate-snippets
(use 'rm -rf' if you really want to remove it including all of its history)
我做错了什么?显然只是像 git 那样做 rm -rf
告诉我这样做是不够的,因为 .gitmodules 文件中的子模块条目将保留。谢谢。
最佳答案
你需要在没有 git 的情况下 rm -rf
:
rm -rf vim/bundle/snipmate-snippets
然后你可以取消初始化子模块:
git submodule deinit vim/bundle/snipmate-snippets
关于git - 删除 git 子模块的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23271424/