Reputation: 11603
I accidentally created a file named :w
. I managed to delete it by using zsh tab feature. But I cannot remove it from my git cache.
git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: Gemfile
# modified: Gemfile.lock
# new file: config/newrelic.yml
#
# Changes not staged for commit:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# deleted: :w
#
then
git rm :w
fatal: pathspec 'w' did not match any files
Upvotes: 10
Views: 2169