为Python项目添加.gitignore文件的最佳做法? [英] Best practices for adding .gitignore file for Python projects?

查看:145
本文介绍了为Python项目添加.gitignore文件的最佳做法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试收集一些默认设置,而我意识到我没有标准的一件事是.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?

推荐答案

在使用< a href = http://www.buildout.org/ rel = noreferrer> 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

感谢 Jacob Kaplan-Moss

我也倾向于放入 .svn ,因为我们在工作时使用了多个SCM。

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

这篇关于为Python项目添加.gitignore文件的最佳做法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆