i\'m working on a big python project, and i\'m really sick if .pyc and *~ files. I\'d like to remove them. I\'ve seen that the -X
flag of git clean would remove
I put local files that fall into this category in .git/info/exclude (e.g. my IDE project files). They you can do a clean like this:
git ls-files --others --exclude-from=.git/info/exclude -z | \
xargs -0 --no-run-if-empty rm --verbose
Where:
You could create an alias, e.g.:
git config --global alias.myclean '!git ls-files --others --exclude-from=.git/info/exclude -z | xargs -0 --no-run-if-empty rm --verbose --interactive'
The --interactive means you have to do git myclean -f to force the deletion.
Reference: http://git-scm.com/docs/git-ls-files (plus the first line of the default .git/info/exclude)