Intellij Idea 9/10,要检查(或不检入)源代码管理的文件夹? [英] Intellij Idea 9/10, what folders to check into (or not check into) source control?

查看:931
本文介绍了Intellij Idea 9/10,要检查(或不检入)源代码管理的文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的团队刚刚从Netbeans转移到Intellij 9 Ultimate,需要知道哪些文件/文件夹通常应该从源代码控制中排除,因为它们不是工作站可移植,即:它们引用仅存在于一个用户计算机上的路径。

Our team has just moved from Netbeans to Intellij 9 Ultimate and need to know what files/folders should typically be excluded from source control as they are not "workstation portable", i.e.: they reference paths that only exist on one user's computer.

据我所知,Intellij想要忽略大部分.idea项目,包括

As far as I can tell, Intellij wants to ignore most of the .idea project including

.idea/artifacts/*
.idea/inspectionProfiles/*
.idea/copyright/*
.idea/dataSources.ids
.idea/dataSources.xml
.idea/workspace.xml

然而,它似乎想要检查每个模块的根目录中存在的.iml文件。

However, it seems to want to check in the .iml files that exist in each module's root directory.

我最初通过命令行检查整个.idea目录,这显然不知道是什么应该被理念忽略。通常会忽略整个.idea目录吗?

I originally checked in the entire .idea directory via the command line which is obviously not aware of what "should" be ignored by Idea. Is the entire .idea directory typically ignored?

推荐答案

我们有常见问题解答文章,涵盖了这个问题。

We have a FAQ article covering this question.


默认情况下,所有最新的IDE版本都使用[.idea]格式。
以下是您需要分享的内容:

[The .idea] format is used by all the recent IDE versions by default. Here is what you need to share:


  • .idea 目录下的所有文件项目根 workspace.xml tasks.xml 文件,用于存储用户特定设置

  • 全部 .iml 模块文件,可以位于不同的模块目录中(适用于IntelliJ IDEA)

  • All the files under .idea directory in the project root except the workspace.xml and tasks.xml files which store user specific settings
  • All the .iml module files that can be located in different module directories (applies to IntelliJ IDEA)

小心关于分享以下内容:


  • 产生签名版本的Android工件(将包含密钥库密码)

  • 在IDEA 13及更早版本 dataSources.ids 中, datasources.xml 可以包含数据库密码。 IDEA 14 解决了这个问题

  • Android artifacts that produce a signed build (will contain keystore passwords)
  • In IDEA 13 and earlier dataSources.ids, datasources.xml can contain database passwords. IDEA 14 solves this problem.

您可以考虑不要分享以下内容:


  • .iml 基于 Gradle Maven 项目的文件,因为这些文件将在导入时生成

  • gradle.xml 文件,查看此讨论

  • 用户词典文件夹(以避免在其他开发人员具有相同名称时发生冲突)

  • .idea / libraries ,以防他们从Gradle或Maven生成项目

  • .iml files for the Gradle or Maven based projects, since these files will be generated on import
  • gradle.xml file, see this discussion
  • user dictionaries folder (to avoid conflicts if other developer has the same name)
  • XML files under .idea/libraries in case they are generated from Gradle or Maven project

.idea 目录是旧.ipr(Idea Project)文件的替代品,如果你想在用户之间共享项目,那么你需要共享.idea文件夹(FAQ中提到的例外情况)和所有.iml文件。

.idea directory is a replacement for the old .ipr (Idea Project) file and if you want to share the project between users, then you need to share .idea folder (with the exceptions mentioned in the FAQ) and all the .iml files.

这篇关于Intellij Idea 9/10,要检查(或不检入)源代码管理的文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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