2012-07-24 87 views
6

我已经添加了一个文件,并且还提交了webpageone fresh.rhtml。我留下了一个名字空间。当我尝试使用删除,:Git删除名为空间的文件

git rm -f /webpageone fresh.rhtml 

我得到这个错误:

pathspec '/webpageone' did not match any files. 

我试着删除其他文件和它的工作...所以问题是间隔。我该如何删除它?

回答

15

这是一个shell问题,而不是git问题。你需要逃离这个空间。这应该工作:

git rm -f /webpageone\ fresh.rhtml 

我想这也应该工作:

git rm -f "/webpageone fresh.rhtml" 
+0

非常感谢:) – 2012-07-24 07:14:38

+0

我这里使用的提到的第二命令,但没有奏效。它在第二个命令中删除了斜线后就起作用了。 git rm -f“New Text Document.txt” – nccsbim071 2013-07-17 12:18:13