我已经做过这个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 themes/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不知道它的存在,因此也无法删除它。我陷入困境,该怎么解决呢?