git rm -r在子模块中不起作用

时间:2012-05-11 08:43:54

标签: git git-submodules git-rm

尝试按照git book

中的说明更改子模块
$ git rm -r vendor/html-minifier
$ git submodule add https://github.com/kangax/html-minifier.git vendor/html-minifier

但它失败了以下

rm 'vendor/html-minifier'
fatal: git rm: 'vendor/html-minifier': Is a directory

1 个答案:

答案 0 :(得分:5)

来自http://txt.binnyva.com/2008/07/remove-a-folder-from-git/

git rm -r vendor/html-minifier/.

或者(来自https://serverfault.com/questions/256421/cant-git-rm-a-directory

git rm --cached -r dirname