合并 IntelliJ IDEA .IPR 和 .IWS 文件 [英] Merges on IntelliJ IDEA .IPR and .IWS files

查看:16
本文介绍了合并 IntelliJ IDEA .IPR 和 .IWS 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们将 IntelliJ .IPR 和 .IWS 文件保存在我们的源代码管理中,但 IntelliJ 只需打开它们就会不断修改它们,即使项目没有完成任何工作.

We keep our IntelliJ .IPR and .IWS files in our source control, but they keep getting modified by IntelliJ just by opening them, even without any work being done on the project.

我们做错了什么?

推荐答案

我们将 IntelliJ .IPR 和 .IWS 文件保存在我们的源代码控制中,但它们会不断被 IntelliJ 修改,即使项目没有完成任何工作,只需打开它们即可."

"We keep our IntelliJ .IPR and .IWS files in our source control, but they keep getting modified by IntelliJ just by opening them, even without any work being done on the project."

.IWS 文件绝对是每个开发人员的文件,因此不应受源代码控制.

The .IWS file is definitely a per developer file so it shouldn't be under source control.

至于最近项目中的 .IPR 文件,我们最初尝试将此文件版本化,在概念上接近它,就像处理 .Net 项目和 VS.Net .SLN 文件一样.我们的目标是让开发人员在 15 分钟内在干净的 PC 上启动并运行,包括安装 IDE 或本地数据库等相关软件所需的时间.最后,我们花了一些时间来调整本地配置,如下所示.

As for the .IPR file on a recent project we initially tried to version this file approaching it conceptually as you would with a .Net project and the VS.Net .SLN file. Our goal was to get a developer up and running on a clean PC within 15 minutes including the time it takes to install dependent software like the IDE or a local database. In the end we came close with some time to tweak the local configuration as per below.

问题是 .IPR 文件比 .sln 文件存储更多的设置 - 例如单个插件的设置.因此,覆盖的主要原因是如果具有不同插件配置的开发人员打开 IPR 文件,则插件的一些默认设置将写入文件.我们认为开发人员不应将自己限制在给定的插件超集(只是最低配置).

The problem is the .IPR file stores more settings than a .sln file -eg settings for individual plugins. So a major cause for the overwrites is if a developer with a different plugin configuration opens the IPR file some default settings for the plugin are written to the file. We felt developers should not have to restrict themselves to a given plugin super set (just a minimum configuration).

我们缓解问题的方法(虽然没有完全解决)是切换到 .idea 文件夹格式.这将获取 .IPR 文件的内容并将许多节点拆分为 .idea 子文件夹中的单个文件和文件夹.从这里我们能够从源代码控制中排除许多经常写入文件的内容.我们排除的一些文件是:

The way we alleviated the problem (although not entirely solved) was to switch to the .idea folder format. This takes the content of the .IPR file and splits many of the nodes into individual files and folders in the .idea sub-folder. From here we were able to exclude many of the frequently written to files from source control. Some of the files we excluded were:

  • workspace.xml
  • dataSources.xml
  • sqlDataSources.xml
  • dynamic.xml

我们希望 IntelliJ 不理会的一些文件是(尽管这也可能归咎于插件开发人员,而不仅仅是 Jetbrains):

Some files we'd like IntelliJ to leave alone are (although the blame can also go to the plugin developers and not just Jetbrains):

  • projectCodeStyle.xml(因此我们可以在项目中获得一致的代码格式 - 同样可以根据开发人员的本地插件组合覆盖).
  • runConfigurations 文件夹下的任何文件.配置运行配置可能很耗时,特别是如果您有一个包含多个方面的复杂应用程序.通过简单地打开 IDE 或构建来改变的最常见的愚蠢事情是 RunnerSettings 下的DEBUG_PORT"选项.我的意见是,如果它是动态分配的,为什么不具有动态"值?
  • misc.xml.该文件还包含插件配置.一些设置看起来很方便分享,而另一些则更适合个人配置.例如,IvyIDEA 插件会为您的 ivy 配置文件放置一个绝对路径.
  • 模块文件.这些大多是单独留下的,但一个不必要的覆盖示例是 IvyIDEA 插件将本地常春藤缓存位置的详细信息放在此文件中.但这又是插件的错,而不是真正的 Jetbrains.

希望这会有所帮助.

基督徒.

这篇关于合并 IntelliJ IDEA .IPR 和 .IWS 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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