我已经这样做了 100 次。我从目录中删除了一个文件,然后运行 git status 看起来不错。
# Changes not staged for commit:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# deleted: themes/custom/gitb/templates/views-view-field--field-overall-rating.tpl.php
#
然后我运行 git rm theme/custom/gitb/templates/views-view-field--field-overall-rating.tpl.php 并收到一条错误消息
error: pathspec 'themes/custom/gitb/templates/views-view-field--field-overall-rating.tpl.php' did not match any file(s) known to git.
git status “知道”该文件,但 git rm 不知道也不会删除它。我被卡住了,我该如何解决?