As an accident of typing, I've ended up with a file in the repo ending with the *
character. I'm using Bash.
Let's call the file "bin/abc*"
. Also there are files bin/xyz
and others beginning with bin/abc
such as bin/abc1
and bin/abc2
.
I've tried a whole bunch of tactics, including:
$ git rm bin/abc\*
, which deletes all the other files, but not the "bin/abc*"
;$ git rm bin/abc[*]
, which deletes all the other files, but not the "bin/abc*"
;$ git rm bin/abc\\*
, which recognises no files;$ git rm bin/abc[^a-z]
, which recognises no files;"git rm "bin/abc*"
, which deletes all the other files, but not the "bin/abc*"
;I've run out of ideas.
Assuming the file is tracked, put the filename in quotes, e.g.
git rm "bin/abc*"
If it isn't tracked, use rm
instead of git rm
:
rm "bin/abc*"