Git and IntelliJ IDEA

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

External

Internal

Overview

The contents of the .idea directory can be generally shared, with the exceptions mentioned below.

The module .iml files located throughout the source directory tree should also be shared, unless you plan to import the project locally with Maven or Gradle import functionality. In that case, the .iml files will be created.

May Consider Not to Share

The .iml module files present across the source code tree may not be shared in case the project is locally imported with Gradle or Maven import functionality. Also, XML files under .idea/libraries may not be shared in case they are generated from Gradle or Maven project.

What Not to Share

User-specific settings:

.idea/**/workspace.xml
.idea/**/tasks.xml

User dictionaries should not be shared, because they may conflict with other users'.

.idea/**/dictionaries

In IDEA 13 or earlier, don't share datasources.xml because they contain user passwords.

gradle.xml points to the specific local path where Gradle is installed, so it should shared.

Suggested .gitignore

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/dictionaries
.idea/**/shelf

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# File-based project format
*.iws

# IntelliJ
out/