我应该将我的项目文件置于版本控制之下吗? [英] Should I keep my project files under version control?

查看:33
本文介绍了我应该将我的项目文件置于版本控制之下吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是否应该像 Eclipse 的 .project、.classpath、.settings 一样将项目文件保留在版本控制之下(例如 Subversion、GitHub、CVS、Mercurial 等)?

Should I keep project filesm like Eclipse's .project, .classpath, .settings, under version control (e.g. Subversion, GitHub, CVS, Mercurial, etc)?

推荐答案

您确实希望保持版本控制任何可移植的设置文件
含义:
任何没有绝对路径的文件.
这包括:

You do want to keep in version control any portable setting files,
meaning:
Any file which has no absolute path in it.
That includes:

  • .project,
  • .classpath(如果没有使用绝对路径,可以使用IDE变量或用户环境变量)
  • IDE 设置(这是我强烈反对已接受"答案的地方).这些设置通常包括静态代码分析规则,对于将此项目加载到他/她的工作区中的任何用户来说,这些规则对于一致地强制执行至关重要.
  • IDE 特定的设置建议必须写在一个大的 README 文件中(当然也要进行版本控制).
  • .project,
  • .classpath (if no absolute path used, which is possible with the use of IDE variables, or user environment variables)
  • IDE settings (which is where i disagree strongly with the 'accepted' answer). Those settings often includes static code analysis rules which are vitally important to enforce consistently for any user loading this project into his/her workspace.
  • IDE specific settings recommandations must be written in a big README file (and versionned as well of course).

我的经验法则:
您必须能够将项目加载到工作区中,并在其中包含在 IDE 中正确设置它并在几分钟内开始运行所需的一切.
无需额外的文档、维基页面或其他内容.
加载、设置、开始.

Rule of thumb for me:
You must be able to load a project into a workspace and have in it everything you need to properly set it up in your IDE and get going in minutes.
No additional documentation, wiki pages to read or what not.
Load it up, set it up, go.

这篇关于我应该将我的项目文件置于版本控制之下吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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