How to manage IDE files in a git repository?

折月煮酒 提交于 2019-12-23 07:28:51

问题


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?


回答1:


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.




回答2:


It could be helpful to use versioning for the IDE files except files which store user specific settings. See also https://intellij-support.jetbrains.com/hc/en-us/articles/206544839-How-to-manage-projects-under-Version-Control-Systems.

Advantage of using version control for these files is

  • Sharing of code styles for the whole development team
  • Manage and share nested repositories that are under version control as well.
  • etc.


来源:https://stackoverflow.com/questions/17024379/how-to-manage-ide-files-in-a-git-repository

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!