66
Plenty of ways to remove them:
git ls-files | grep '\.pwc$' | xargs git rm
find . -name *.pwc | xargs git rm
Note: If you haven’t committed them, just use rm
, not git rm
.
To ignore them in the future, simply add *.pwc to the .gitignore. (If you don’t have one, create a file named .gitignore at the top level of your repository, and just add a single line saying “*.pwc”)
30
You can also use the following:
git rm -r '*.pwc'
and then make those files ignored by git:
echo '*.pwc' >> .gitignore
The last one is in case if you already have .gitignore file, if not, us single ‘>’ sign.
- [Django]-Django Rest Framework – Authentication credentials were not provided
- [Django]-Dropdown in Django Model
- [Django]-Mysql error : ERROR 1018 (HY000): Can't read dir of '.' (errno: 13)
6
In Windows this worked for me:
git rm -r '*.pwc' -f
And for keeping it in .gitignore
echo '*.pwc' >> .gitignore
- [Django]-How to add a cancel button to DeleteView in django
- [Django]-Difference between Django's filter() and get() methods
- [Django]-How can i test for an empty queryset in Django?
3
Jefromi’s answer will remove them for the present and the future…you could also remove them in the past using git filter-branch. Of course this has some other ramifications, like requiring everyone else working on the repo to re-checkout (and possibly rebase any work they haven’t pushed to the main repo). Depends how big the PWC files are, you may want to do this if they are wasting a lot of diskspace in your repo (since every time you clone a git repo, you get every file and every revision)
- [Django]-Django – Circular model import issue
- [Django]-Changing a project name in django
- [Django]-Alowing 'fuzzy' translations in django pages?