Accidentally, I have pushed the .pyc files to the master repository. Now I want to delete them but I can´t do it. Is there any way to remove them directly from the Bitbucket sit
This works for me,
find . -name '*.pyc' | xargs -n 1 git rm --cached
I used simeg's solution but also wanted to deleted tons of *.pyc files added by mistake to a branch. I used awk to delete them from cache recursively.
git status | awk '{if($1=="modified:" && $2!=".gitignore") ; system("git rm --cached "$2)}'
Then, I deleted the files from my local
find . -name *.pyc -delete
To remove all .pyc
files use git rm -rf *.pyc
Then add the *.py[co]
to your .gitignore file. (This will prevent .pyc and .pyo files from getting committed in the future commits)
another liner for fun to remove all the pyc files.
find . -name '*.pyc' -exec git rm {} \;
don't forget to follow the steps in other answers to commit and add gitignore.