To remove a challenging-named file by Git rm

The name of the file is "\033[A.tex". Note that the filename includes two times the character ".

I run unsuccessfully

git rm ""\033[A.tex""

and

git rm "\033[A.tex"

How can you remove the file from Git?

[edit]

The filename is more challenging.

Situation

alt text http://files.getdropbox.com/u/175564/git-rm.png

Upvotes: 2

Views: 367

Answers (5)

Alan Haggai Alavi
Alan Haggai Alavi

Reputation: 74202

Single quotes should help:

git rm '"\\033\[A.tex"'

Upvotes: 1

simplyharsh
simplyharsh

Reputation: 36373

It will work this way for sure.

git rm \\033\[A.tex

No assumption needed. There is a pattern followed to identify such challenging names(can't find where its documented). But this will work.

EDIT

For more chalenging name

git rm "\"\\033[A.tex\""

Upvotes: 0

Robert Munteanu
Robert Munteanu

Reputation: 68268

Update:

git rm \"\\033\[A.tex\"

Upvotes: 0

Mark Embling
Mark Embling

Reputation: 12821

Does any of the following work?

git rm "\\033[A.tex"
git rm "\*A.tex" (assuming this pattern matches no other files)
git rm "*A.tex" (same assumption)

Upvotes: 1

foobarfuzzbizz
foobarfuzzbizz

Reputation: 58637

Try:

git rm "./\033[A.tex"

That will look in your current directory.

Or try typing ./\033 then pressing tab to autocomplete in some shells.

Upvotes: 0

Related Questions