我有一个关于删除git子模块的问题。我正在使用git来组织我的配置文件和vim插件,其中vim插件是子模块。现在我想要删除一个子模块(按照这里的说明),但我没有成功。
--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)
我做错了什么?很明显,仅仅执行 rm -rf
命令是不够的,因为在 .gitmodules 文件中子模块的条目仍将存在。谢谢。
vim/bundle/snipmate-snippets
只是一个普通的目录,子模块被克隆到其中。它可以是任何其他目录,例如foo/bar/my_submodule
或其他任何目录。 - rafalio