Currently Being Moderated

How to manage IntelliJ IDEA projects under Version Control Systems

VERSION 3

Created on: Dec 13, 2009 10:41 PM by Serge Baranov - Last Modified:  Sep 7, 2011 2:30 PM by Serge Baranov

Depending on the IntelliJ IDEA project format (.ipr file based or .idea directory based), you should put the following IntelliJ IDEA project files under the version control:


.ipr file based format

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

 

.idea directory based format

Share all the files under .idea directory in the project root except the workspace.xml and tasks.xml files which store user specific settings, also share all the .iml module files.

Average User Rating
(3 ratings)




Chris Herron Chris Herron  says:

I have a large multi-module Maven project that was imported to become an IntelliJ project. Cumulatively, there are a lot of libraries.

Under .idea/libraries there are many files of the pattern: "Maven_groupId_artifactId_version.xml"

Since these are all derived from what is already configured in (and inferred from) the pom files, can the .idea/libraries directory be omitted entirely for Maven based projects? 

Anton Makeev Anton Makeev  says in response to Chris Herron:

Hi, Chris,

They cannot be omitted.

It is very core subsystem, that stores files in the .idea/libraries directory, these files are necessary for IDEA

to open an existing project correctly. These files also contain user-defined paths for the libraries, such as paths to sources and javadoc.

Ross Gerbasi Ross Gerbasi  says:

Been working with IntelliJ and Flex projects in SVN, does it make sense that we should also ignore misc.xml from the .idea folder?

I seem to get conflicts on that often as everyone starts up the project.

 

-ross

Serge Baranov Serge Baranov  says in response to Ross Gerbasi:

No, misc.xml must be in the version control. What kind of conflicts do you get with it?

Ross Gerbasi Ross Gerbasi  says in response to Serge Baranov:

this line is being added whenever I open my project, other developers do not have this line in there file

 

<component name="IdProvider" IDEtalkID="6CD5B8E1EF16C99D654FFF49E5CF4062" />

 

I am guessing they are not using IDETalk... It does not happen often but I would think any user specific stuff would not be shared across subversion though....

 

-ross

Serge Baranov Serge Baranov  says in response to Ross Gerbasi:

Thanks for the details, I've submitted youtrack.jetbrains.net/issue/IDEA-54149. You can follow it for progress.

Ross Gerbasi Ross Gerbasi  says in response to Serge Baranov:

Also in this file, in another project I had this added at the bottom

 

inside the <component name="SvnBranchConfigurationManager"> tag

 

<option name="myConfigurationMap">
      <map>
        <entry key="$PROJECT_DIR$">
          <value>
            <SvnBranchConfiguration>

                  <option name="trunkUrl" value="svn://svn.server.com/PATH/to/module/root" />
            </SvnBranchConfiguration>

             ...

 

With a bunch of trunk URL's pointing at different module roots.

 

I think what I did was after the project was in version control I went to the changes panel and clicked refresh. Suddenly this was in my misc.xml file. Another developer got a conflict

when he attempted to update.

 

I am not sure if these are just ok for everyone to share, or if it was just a conflict between IDEtalk stuff and then this being added.

 

-ross

Serge Baranov Serge Baranov  says in response to Ross Gerbasi:

VCS branches configuration is OK to share.

Ross Gerbasi Ross Gerbasi  says in response to Serge Baranov:

Thanks. what does that IDE talk ID mean for now? should everyone  disable the plugin?

 

-ross

Serge Baranov Serge Baranov  says in response to Ross Gerbasi:

This FAQ is not the best place for the discussion, please either contact us by e-mail, or better move the discussion to the issue tracker (see the link I posted above). I don't know what it means, watch the tracker issue for progress.

Chris Herron Chris Herron  says in response to Serge Baranov:

Regarding the sharing of (or not sharing) VCS branches, see: http://youtrack.jetbrains.net/issue/IDEA-23653

David Cameron David Cameron  says:

Random changes to the *.iml files and files under IDEA seem to make this impractical at best. Worst offenders are line order changes in iml files and empty blocks appearing or disappearing. For example, I have this change sitting in my working copy right now in Project_Default.xml, and have no idea how or why it ended up there:

-      <option name="ignorableAnnotations">

-        <value />

-      </option>

Michael Greenspan Michael Greenspan  says:

Is there a way to move the locations of the .iml files? It seems that they need to be in the module's root directory, but not everyone on my team will be using intellij as their IDE, and I don't want to add noise in those directories. I want to put all of the intellij configuration into a single folder. Is that possible?

Serge Baranov Serge Baranov  says in response to Michael Greenspan:

Location of the module files can be specified when adding new modules, there is no automated way to change it later.

Michael Greenspan Michael Greenspan  says in response to Serge Baranov:

Ah ok I see now. I was selecting the option to create projects over existing sources. I had to create the project from SCRATCH to be able to specify where the iml files go. Thanks.

Anatoliy Kolesnick Anatoliy Kolesnick  says:

I am using WebStorm and it puts folllowing content to misc.xml:

     

    <?xml version="1.0" encoding="UTF-8"?>

      <project version="4"> 

          <component name="ProjectResources">   

              <default-html-doctype>jar:file:\C:\Program Files (x86)\JetBrains\WebStorm 5.0.4\lib\webide.jar!\resources\html5-schema\html5.rnc</default-html-doctype> 

          </component> 

          <component name="ProjectRootManager" version="2" />

      </project>

         

         

         

        I should put misc.xml under source control, but reference to WebStorm installation folder is too machine specific and may differ between users at least by WebStorm version or by OS (Mac/Linux) WebStorm is installed on.

        I tried to replace part of path with $APPLICATION_HOME_DIR$, but after reopening the project it was replaced back to full path.

         

        So I am curious, what to do in such a case?

        Serge Baranov Serge Baranov  says in response to Anatoliy Kolesnick:

        It looks like a bug, please report at http://youtrack.jetbrains.net/issues/IDEA and we'll try to address this problem.