.gitignore for Python developers
Posted on July 23, 2010 by Mikko Ohtamaa
Filed Under git, plone, python, technology, web development, zope
If you are using Git for version control for your Python egg and buildout development below are is a sample which you might want to put into your .gitignore file.
*.mo *.egg-info *.egg *.EGG *.EGG-INFO bin build develop-eggs downloads eggs fake-eggs parts dist .installed.cfg .mr.developer.cfg .hg .bzr .svn *.pyc *.pyo *.tmp*
Suggestions for new ignores are welcome.
Read our blog
Subscribe mFabrik blog in a reader
Follow us on Twitter
Mikko Ohtamaa on LinkedIn
Other posts by Mikko Ohtamaa



How about Jython class files (*.class, the equivalent of *.pyc)?
And if any of the developers use Mac OS X, ignore the .DS_Store folders.
For emacs users:
*~
And perhaps:
*.bak
Oh, and since you are ignoring .bzr and .hg, you will want to ignore their ignore files as well, so:
.bzrignore
.hgignore
I don’t know if it belongs here, but I usually also ignore
*.LCK
*.lck
to avoid fallout from dreamweaver users with whom i may share my source tree. (Yup, web developer here)
I have “dist” in addition, which gets created whenever you make a release. You also could ignore virtualenv things as well: “.Python include lib” and finally I have “local.cfg” in my list.
If you are using coverage.py to measure code coverage, then you’ll also want to ignore:
.coverage
and probably:
htmlcov
If you are building C extensions, then add:
*.pyd *.so