Subversion allows you to exclude certain files using regular expressions. This needs to be applied to each directory individually. So, if you add a new directory I think you will need to run the command again. To apply the svn:ignore property to your project you just need to do two things:
Create a file (.svnignore) with the regular expressions
*.pyc
*~
Run svn propset on the project
svn -R propset svn:ignore -F .svnignore .
-R indicates that you are doing this recursively so all the directories ignore these.
-F indicates the file we just created with the regular expressions.
EDIT 5/27/08:
If you’ve already got yourself into the mess of versioning your compiled files, then you might want to do a few things.
1) Revert all the .pyc files (you can always recompile them). You don’t want there to be any local changes when you try to delete them:
find -name "*.pyc" -exec svn revert {} \;
2) Delete all the .pyc files using `svn delete`:
find -name "*.pyc" -exec svn delete {} \;
3) Finally recompile and re-run the svn ignore code above
3 responses so far ↓
Starting a new Django Project with Versioning « Pandemonium Illusion // May 12, 2008 at 8:56 pm |
[...] Oh, and you might want to read about excluding .pyc files in svn. [...]
Jökull // July 9, 2008 at 9:51 am |
Apparently .pyc is ignored by default in the new Subversion.
Isaac // June 1, 2009 at 9:44 pm |
The command should be:
find ./ -name “*.pyc” -exec svn revert {} \;
It was missing a path.
–
Isaac