views:

145

answers:

4

I'm trying to collect some of my default settings, and one thing I realized I don't have a standard for is .gitignore files. There's a great thread showing a good .gitignore for Visual Studio projects, but I don't see many recommendations for Python and related tools (PyGTK, Django).

So far, I have...

*.pyc
*.pyo

...for the compiled objects and...

build/
dist/

...for the setuptools output.

Any more recommendations for me?

+2  A: 

One question is if you also want to use git for the deploment of your projects. If so you probably would like to exclude your local sqlite file from the repository, same probably applies to file uploads (mostly in your media folder). (I'm talking about django now, since your question is also tagged with django)

lazerscience
Understood. As Django doesn't enforce much of a file name and directory structure, it's hard to specify these in advance. But I can at least make a note of it so I remember when I'm creating a new project.
ewall
Well guess you should at least make it common to have all your user uploaded files in ONE folder in your media dir, eg. `media/uploads`, so you can 'ignore' them all with one rule...
lazerscience
+3  A: 

local_settings.py, for django projects.

*~ for all projects.

Ofri Raviv
That makes sense. I like this method of separating the general config from the specific/local/private.
ewall
+2  A: 

Here are some other files that may be left behind by setuptools:

MANIFEST
*.egg-info
jathanism
I think I might leave these out of my default, because some of my projects have setuptools distributions that would need 'em. But for plugins and such, yes.
ewall
+1  A: 

When using buildout I have following in .gitignore (along with *.pyo and *.pyc):

.installed.cfg
bin
develop-eggs
dist
downloads
eggs
parts
src/*.egg-info
lib
lib64

Thanks to Jacob Kaplan-Moss

Also I tend to put .svn in since we use several SCM-s where I work.

rebus
Keeping an svn repo in the same tree as your git repo!? What kind of monster would do such a thing?
Daenyth
@Daenyth *giggle*, well not really, but I tend to find some leftover `.svn` directories lying around if I get a component from another source (specially in older components) and also I'm quite lazy so I sometimes copy checkouts instead of exporting stuff from SVN. I once even saw a guy actually committing leftover .svn dirs in GIT. You can run into all kind of weird things when working with silly people.
rebus
Sounds like your team needs to be educated a bit better on how to use their tools...
Daenyth
Well I am trying to hook them on StackOverflow... :p
rebus
I haven't used Buildout yet, but probably will need to someday soon... so I'll put 'em on the list. Thanks!
ewall