How to manage projects under Version Control Systems

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 the .idea directory in the project root except the workspace.xmlusage.statistics.xml, and tasks.xml files and the shelf directory which store user-specific settings
  • All the .iml module files that can be located in different module directories (applies to IntelliJ IDEA)

Starting with the 2019.1 version,  IntelliJ can automatically add to Version Control everything that needs sharing 

Be careful about sharing the following:

  • Android artifacts that produce a signed build (will contain keystore passwords)
  • In IDEA 13 and earlier dataSources.ids, datasources.xml can contain database passwords. IDEA 14 solves this problem.

You may consider not to share the following:

  • .iml files and .idea/modules.xml file for the Gradle or Maven based projects, since these files will be generated on import
  • 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 or Maven 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

 

For Git you can use this .gitignore as the starting point.

92 comments
Comment actions Permalink

Just thought I'd comment I'm having problems with misc.xml as well. My main reason for including .idea into VCS is so that other developers can clone the project and open up PyCharm with all the default configs set without headache and can start developing right away. I also like the idea of having a .idea/local so we know exactly what can be put into .gitignore. Serge Baranov, is there a list of files that are generated upon import that we can exclude from VCS?

Edited by Rlele5
0
Comment actions Permalink

I somhow changed the vcs root to the folder I have all my projects in and some of the files are marked red, I am guessing I did something wrong by changing the root can someone help me restore the default settings

 

0

Please sign in to leave a comment.

Have more questions?

Submit a request