Knowledge Base/Version Control

How to manage projects under Version Control Systems

Serge Baranov
posted this on March 19, 2013 05:03

If you decide to share IDE project files with other developers, follow these guidelines:

Directory based project format (.idea directory)

This format is used by all the recent IDE versions by default. Here is what you need to share:

  • 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)

Be careful about sharing the following:

  • Android artifacts that produce a signed build (will contain keystore passwords)
  • dataSources.ids, datasources.xml (can contain database passwords)

You may consider not to share the following:

  • 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 project

Legacy project format (.ipr/.iml/.iws files)

  • Share the project .ipr file and all the .iml module files, don't share the .iws file as it stores user specific settings
 

Comments

User photo
David Perez Ingeniero
Gmail

What about .idea/libraries?

Should I store them in the source control repository?

There are many *.xml that change frequently.

December 27, 2013 14:14
User photo
Serge Baranov
Gmail

David Perez, it would depend on the project you are using. If the project is Maven or Gradle based and these library files are generated automatically on import, you can exclude them from the version control. When the libraries are configured manually by the user, they should be shared.

December 27, 2013 14:17
User photo
David Perez Ingeniero
Gmail

Thanks for the very quick and clarifying reply.  In my case they are managed by Maven and SBT, so I can remove them.

December 27, 2013 14:22
User photo
Ladicek
Gmail

This is so wrong... A whole lot of files inside .idea store user-specific settings, depending on a variety of different things like the set of installed plugins. Also, in practice, not all project settings can be shared among all developers. (My personal favorite -- spell checking. I always turn it off as it is rather distracting, the negative is that it's a change inside .idea that I have to deal with.)

January 06, 2014 18:41
User photo
Erdinc

We do also have a similar problem about having personal/custom project settings. Especially regarding including/excluding certain parts of large modules with a lot of css/javascript. Without excluding stuff, intellij slows down a lot. Is there a way to include other xml files from within .iml files? So maybe we can place a file that would have what is going to be included/excluded in each users home folder and import that file from the main module .iml file that is in version control?

February 12, 2014 07:23
User photo
Serge Baranov
Gmail

Erdinc, it's not possible. Your use case and the feature request is welcome at http://youtrack.jetbrains.com/issues/IDEA. Please describe what configuration files are different between the users and how you want to share them.

February 12, 2014 07:27
User photo
Dave

Here's my current issue with checking in *.iml: http://youtrack.jetbrains.com/issue/RUBY-14941

February 13, 2014 06:00
User photo
Mock

if dataSources.xml is supposed to be excluded, should sqlDataSources.xml also be excluded?

February 14, 2014 19:56
User photo
Mock

Actually I don't think you can ignore dataSources.xml, because if you have configured some JPA/ORM persistence checking in your project, then the .iml file will contain those references, which appear to reference structures in sqlDataSources.xml which reference structures in dataSources.xml. Does that sound right?

February 14, 2014 20:08