我添加了一个文件并提交了webpageone fresh.rhtml
。我在文件名中留下了一个空格。当我试图移除它时,使用以下命令:
git rm -f /webpageone fresh.rhtml
I get this error:
pathspec '/webpageone' did not match any files.
我试过移除另一个文件,它可以工作..... 所以问题出在了空格上。我该如何去掉它?
我添加了一个文件并提交了webpageone fresh.rhtml
。我在文件名中留下了一个空格。当我试图移除它时,使用以下命令:
git rm -f /webpageone fresh.rhtml
I get this error:
pathspec '/webpageone' did not match any files.
我试过移除另一个文件,它可以工作..... 所以问题出在了空格上。我该如何去掉它?
这是一个shell问题,而不是git的问题。你需要转义空格。这应该可以解决:
git add file\ with\ spaces.txt
git rm -f /webpageone\ fresh.rhtml
我猜这个也应该可以工作:
git rm -f "/webpageone fresh.rhtml"