Skip to content

Preparation of .idea directory

Julian Blazek edited this page Jun 20, 2024 · 4 revisions

Most IntelliJ projects are facing issues with the question "Which of the project files can I safely commit to my version control?". And the answer will probably be: "it depends". It depends on the plugins used, and how many project settings are changed from the default values.

So a good starting point for a .gitignore file might be the following:

# User-specific stuff
**/.idea/workspace.xml
**/.idea/tasks.xml
**/.idea/misc.xml
**/.idea/sonarlint-state.xml
**/.idea/jarRepositories.xml
**/.idea/usage.statistics.xml
**/.idea/dictionaries
**/.idea/shelf
**/.idea/sonarlint
**/.idea/sqldialects.xml
**/.idea/vcs.xml
**/.idea/compiler.xml
**/.idea/inspectionProfiles

# Generated files
**/.idea/contentModel.xml

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

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

# File-based project format
*.iws
*.iml
*.ipr

Most of the remaining files may probably be safely added to the version control.

(Please let us know if there are files missing from the list.)

Note: in case some of the listed files have already been committed it could be a good idea to remove them from version control.

Clone this wiki locally