IntelliJ IDEA 9/10,哪些文件夹要签入(或不签入)源代码管理? [英] IntelliJ IDEA 9/10, what folders to check into (or not check into) source control?

查看:28
本文介绍了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 忽略.通常会忽略整个 .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?

推荐答案

我们有一个 FAQ 文章 涵盖了这个问题.

We have a FAQ article covering this question.

[.idea] 格式被所有最近的 IDE 版本默认使用.以下是您需要分享的内容:

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

  • 项目根目录下.idea目录下的所有文件除了workspace.xmltasks.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 文件用于基于 GradleMaven 的项目,因为这些文件将在导入时生成
  • gradle.xml 文件,查看此讨论
  • user dictionaries 文件夹(避免其他开发者同名时发生冲突)
  • .idea/libraries 下的 XML 文件,以防它们从 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 文件夹(提到的例外在常见问题解答中)和所有 .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天全站免登陆