2012-07-24 78 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