Telling Subversion to Ignore .pyc Files
Posted: July 30, 2007
Author: Scott Newman
Category:
Python,
Subversion
When working with Subversion, you can tell it to ignore certain types of files. In my case, I want it to ignore .pyc files.
I know there is a way to do this globally using global-ignores, but I haven't played with it. If you know what it is, please add a comment!
A caveat: I am NO Subversion expert. I've only scratched the surface of what can be done with this amazing piece of software, and I'm honestly afraid of it right now. I'm scared that I'm going to run one of these 'voodoo' commands and hose my repository irreparably. (I run a full export weekly just in case) Hopefully, in the coming weeks and months, I'll get much better, and share my findings.
me@mymachine:/home/code/python/myproject$ svn status M newfile.py ? newfile.pyc
How do you tell Subversion to ignore the newfile.pyc file? It's pretty easy, with the right syntax. Just run the propset svn:ignore command for a specific folder:
me@mymachine: /home/code/python$ svn propset svn:ignore "*.pyc" ./* property 'svn:ignore' set on './myproject'
There you have it! Now, when you run your SVN status command:
me@mymachine:/home/code/python/myproject$ svn status M newfile.py

