2

Possible Duplicate:
git rm file name with space

I have a Git repository and I'm trying to delete a file but it has a single quote (or apostrophe) (') in the filename.

For example, git'hub.txt

Each time I try to delete the file I type:

git rm git'hub.txt

it goes

git rm git'hub.txt

>

waiting until I end it with another '.

Is there a way to delete this file without it doing that?

Community
  • 1
  • 1
user1797587
  • 33
  • 1
  • 6

1 Answers1

1

What differs from "git rm file name with space" is that, this time, the special character is a simple quote.

A simple quotes are also called strong quoting: they prevent characters from having special meanings... except from the single quote itself.

That is why you need to escape that one.

git rm 'git\'hub.txt'

If the special character had been a space, no escape would have been needed:

git rm 'git hub.txt'
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250