Git failed rm -cached files

I want to delete all my * .pyc files from version control. I tried git rm -r cached ./*.pyc but got fatal: pathspec 'widgets.pyc' did not match any files error fatal: pathspec 'widgets.pyc' did not match any files . I thought widgets.pyc not in version control, but git status widgets.pyc says my file is on branch master .

Any remedy for my problem?

+7
source share
1 answer

Try git rm -r --cached ./\*.pyc (note the backslash character before the asterisk) so that your shell passes the wildcard character to git instead of expanding it yourself.

+16
source

All Articles