如何管理git存储库中的IDE文件? [英] How to manage IDE files in a git repository?

查看:170
本文介绍了如何管理git存储库中的IDE文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

该应用程序是使用Sencha Architect开发的,它使用大量辅助文件来管理各种IDE相关事物(导出路径,IDE版本等)。



在Sencha Architect IDE中,每当团队成员刚刚打开一个项目时,这些文件中的一些文件就会发生变化。



举一个特别恼人的变化的例子,考虑一下属性 exportPath 在Architect生成的 *。xds 文件中。我将有一个我选择的服务器发布到特定路径,其他团队成员将有不同的服务器/路径配置。



在我们的代码库中,我非常想要在独立的存储库中使用IDE文件:
$ b



  1. 在一个子模块中(是的,我知道git-specific)或
  2. 驻留在用户机器上,而VCS忽略它们的变化。

这里需要注意的是,Sencha Architect期望文件位于相对于项目的特定位置,所以IDE文件必须位于相同的位置作为正常的源文件。



另外,使用.gitignore不是一种选择,因为Sencha Architect会在其中一些信息中写入对其他团队成员开放至关重要的信息他们正确。例如。当开启一个项目时,Sencha Architect可以决定将项目升级到一个更新的版本(如果你想打开项目,它是非可选的),并且在更新过程中,IDE会修改一些源代码,代码文件。其他团队成员必须了解版本升级,才能正确打开项目。



给出了Sencha使用的复杂格式的一些背景。我对我在评估Sencha Architect架构时的负面语气表示歉意,但似乎他们采用了一个好主意(使用元数据和代码生成)有点太过分了(使所有优秀的unix工具(包括git)失效)。

这里的首选方法是什么?为什么?

IDE文件不应该被版本化,除非你有一个非常有说服力的理由。也许你的项目只在特定的IDE中使用插件来构建,你需要对这些设置进行版本化。如果您不需要这些文件来构建或运行您的项目,您可能不应该对它们进行版本化。



您可以使用Git忽略这些文件。特别是,IDE文件适合全球gitignore,因为每个用户都会使用他们想要的任何IDE,并且这些设置应该被应用到他们所有的存储库。


The application is developed using Sencha Architect, which uses a host of auxiliary files for managing various IDE-related things (export paths, versioning of the IDE etc.).

Some of these files will change every time a team member just opens a project in the Sencha Architect IDE.

To give an example of a particularly annoying change, consider the property exportPath in the Architect-generated *.xds files. I will have a server of choice which I publish to, to a specific path, and other team members will have different server/path configurations.

In our code-base, I would very much like to either have the IDE files:

  1. in a separate repository,
  2. in a sub-module (yes, git-specific, I know) or
  3. reside on the user machine, with the VCS oblivious to changes in them.

The key thing to note here is, that Sencha Architect expects the files to be in certain places relative to the projects, so the IDE files must be available at the same place as the normal source files.

Also, using .gitignore is not an option, since Sencha Architect will write information in some of them that are vital for other team-members opening them correctly. E.g. when opening a project, Sencha Architect could decide to upgrade the project to a newer version (its non-optional, if you want to open the project at all), and in the course of updating, the IDE will modify some of the source-code files. The other team members must be aware of the version upgrade in order to be able to open the project correctly.

This SO question gives some background to the convoluted format that Sencha uses. I pardon for the negative tone in my assessment of the architecture of Sencha Architect, but it seems that they took a good idea (using metadata and code generation) a bit too far (invalidating the use of all good unix tools, including git).

what would be the preferred approach here? And why?

解决方案

IDE files should not be versioned unless you have a pretty compelling reason. Perhaps your project only builds using a plugin in a particular IDE and you need to version those settings. If you don't need those files to build or run your project, you probably shouldn't version them.

You can ignore those files using Git. In particular, IDE files are good candidates for the global gitignore as each user will use whatever IDEs they want and those settings should be applied to all of their repositories.

这篇关于如何管理git存储库中的IDE文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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