为 Python 项目添加 .gitignore 文件的最佳实践? [英] Best practices for adding .gitignore file for Python projects?
问题描述
我正在尝试收集我的一些默认设置,我意识到我没有标准的一件事是 .gitignore 文件.有一个很棒的线程显示了适用于 Visual Studio 项目的好 .gitignore,但我没有看到很多关于 Python 和相关工具(PyGTK、Django)的推荐.
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/
...用于 setuptools 输出.
...for the setuptools output.
.gitignore 文件有哪些最佳实践,我可以从哪里获得有关这些最佳实践的更多信息?
What are some best practices for .gitignore files, and where can I go for more about these best practices?
推荐答案
当使用 buildout 我有以下内容.gitignore
(连同 *.pyo
和 *.pyc
):
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
此外,我倾向于将 .svn
放入,因为我们在我工作的地方使用了多个 SCM-s.
Also I tend to put .svn
in since we use several SCM-s where I work.
这篇关于为 Python 项目添加 .gitignore 文件的最佳实践?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!