Remove .pyc files from Git remote repository

ePascoal picture ePascoal · Sep 24, 2014 · Viewed 51.2k times · Source

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 site?

Answer

Falcoa picture Falcoa · Sep 29, 2014
  1. Remove .pyc files using git rm *.pyc. If this not work use git rm -f *.pyc
  2. Commit git commit -a -m 'all pyc files removed'
  3. Push git push
  4. In future commits you can ignore .pyc files by creating a .gitignore file