1

I have git repo and I want to remove directories.

#   deleted:    "4.proste i p\305\202aszczyzny/draw.js"
#   deleted:    "4.proste i p\305\202aszczyzny/index.html"
#   deleted:    "4.proste i p\305\202aszczyzny/js/input.js"
#   deleted:    "4.proste i p\305\202aszczyzny/math.js"
#   deleted:    "4.proste i p\305\202aszczyzny/style.css"
#   deleted:    "proste i p\305\202aszczyzny/draw.js"
#   deleted:    "proste i p\305\202aszczyzny/index.html"
#   deleted:    "proste i p\305\202aszczyzny/js/input.js"
#   deleted:    "proste i p\305\202aszczyzny/math.js"
#   deleted:    "proste i p\305\202aszczyzny/style.css"

and when I run for example:

git rm -r 4.proste i p\305\202aszczyzny/draw.js

I get: fatal: pathspec '4.proste' did not match any files

I also tried running: git rm $(git ls-files --deleted) to list all deleted files and remove them. I get the same error. My folder names are so wierd because of polish characters in name. Now I changed them but now I want to remove them form my repo.

Madbrush
  • 387
  • 1
  • 3
  • 9
  • Try surrounding the directory name / filename with single quotes? `git rm -r '4.proste i p\305\202aszczyzny/draw.js'` – yanhan Jan 02 '14 at 01:49
  • 1
    You have mixed usage of the slash symbols, so this begs the question what operating system are you on. A listing of the file might clarify the problem though. Also, technically git doesn't track folders, it only tracks files. Tab completion should take care of your spaces for you, as the shell sees the spaces. – vgoff Jan 02 '14 at 04:20
  • those `\305` and `\202` sequences look suspiciously like non-ASCII characters, which leads me to believe you are on windows, where Git does not support non-ASCII characters in filenames. using those keywords, you can also find more about it on the internet. – Nevik Rehnel Jan 02 '14 at 08:18

1 Answers1

4

In Bash, you need quotes around filenames with spaces in them to avoid the shell thinking they're separate arguments.

git rm -r "4.proste i p\305\202aszczyzny/draw.js"
Henry Blyth
  • 1,700
  • 1
  • 15
  • 23