Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git delete a file with space in name

Tags:

git

I have added a file and also committed webpageone fresh.rhtml. I left a space in the name. When I a try to remove it, using:

git rm -f /webpageone fresh.rhtml

I get this error:

pathspec '/webpageone' did not match any files.

I tried removing another file and it worked... So the problem is the spacing. How can I remove this?

like image 224
Rene Zammit Avatar asked Jul 24 '12 07:07

Rene Zammit


1 Answers

That's a shell problem, not a git problem. You need to escape the space. This should work:

git rm -f /webpageone\ fresh.rhtml

I guess this should also work:

git rm -f "/webpageone fresh.rhtml"
like image 137
Marcin Koziński Avatar answered Oct 05 '22 02:10

Marcin Koziński