Git and IntelliJ IDEA: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
(16 intermediate revisions by the same user not shown)
Line 11: Line 11:
=Overview=
=Overview=


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


=What Shouldn't Share=
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 [[IntelliJ_Concepts#libraries|.idea/libraries]] may not be shared in case they are generated from Gradle or Maven project.


=What Not to Share=
=What Not to Share=
[[IntelliJ_Concepts#User-Specific_Settings|User-specific settings]]:
<syntaxhighlight lang='text'>
.idea/**/workspace.xml
.idea/**/tasks.xml
</syntaxhighlight>


[[IntelliJ_Concepts#User_Dictionaries|User dictionaries]] should not be shared, because they may conflict with other users'.
[[IntelliJ_Concepts#User_Dictionaries|User dictionaries]] should not be shared, because they may conflict with other users'.
Line 22: Line 33:
.idea/**/dictionaries
.idea/**/dictionaries
</syntaxhighlight>
</syntaxhighlight>
In IDEA 13 or earlier, don't share [[IntelliJ_Concepts#datasources.xml|datasources.xml]] because they contain user passwords.
[[IntelliJ_Concepts#gradle.xml|gradle.xml]] points to the specific local path where Gradle is installed, so it should shared.


=Suggested .gitignore=
=Suggested .gitignore=


<syntaxhighlight lang='text'>
<syntaxhighlight lang='text'>
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/dictionaries
.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/
</syntaxhighlight>
</syntaxhighlight>

Latest revision as of 18:10, 11 May 2018

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/