tags:

views:

38

answers:

1

So somehow OS X allowed me to create a folder with the name "assets\rassets\rassets". Yep, those are \r linebreaks.

Now I've renamed it, but git can't find it to remove it.

git rm "assets\rassets\rassets/default_app_icon.psd"
fatal: pathspec 'assets\rassets\rassets/default_app_icon.psd' did not match any files

All combinations of escaping with \ and " don't do anything.

+2  A: 

That's because '\r' doesn't really mean anything to git or your shell. You need to give it an actual carriage return character.

You can use bash's filename completion to accomplish this -- just type 'git rm assets', and start hitting tab until you get where you need to be.

You can also use the shell command printf with backticks. This should work (just did for me on OS X):

git rm `printf 'assets\rassets\rassets/default_app_icon.psd'`

The printf command works like C's printf(), with support for all the same escape characters (including '\r').

Nicholas Knight
Sweet, it worked, thanks!
Caleb