Max Shaian
Max Shaian

Reputation: 478

PhpStorm .idea in GIT issues

In order to keep codestyles the same for every team member, our projects have PhpStorm config files as a part of GIT.

Conditions

VCS contains config files in .idea. Files list:

Problems

Workaround

If I delete the entire .idea folder with the files in it and PhpStorm reinitializes the settings, everything seemingly works fine.

Have anyone else encountered something similar? What can you recommend?

Upvotes: 1

Views: 534

Answers (2)

LazyOne
LazyOne

Reputation: 165108

Yes, that the known problem when .idea folder is present and not empty but does not have minimal needed files (cannot say for sure, but I guess the IDE wants to see workspace.xml and maybe *.iml + modules.xml to avoid this issue).

https://youtrack.jetbrains.com/issue/IDEA-271728 -- watch this ticket (star/vote/comment) to get notified on the progress.


What can you recommend?

Sadly I've got nothing significant to suggest from my end. I simply do not face such problem (can easily manually workaround it if needed).

The only thing I may suggest is:

  • Make a new project without .idea folder in it.

  • Once the project is created, close it in the IDE and overwrite those files (a simple copy-paste will do just fine).

Upvotes: 3

Muhammad Dyas Yaskur
Muhammad Dyas Yaskur

Reputation: 8088

You should ignore all user-specific config files. Below is the recommended file list that should be added to the .gitignore

# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

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

# AWS User-specific
.idea/**/aws.xml

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

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

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

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn.  Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# SonarLint plugin
.idea/sonarlint/

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

If some files are still on the git, you should delete them and then commit them.

reference: https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore

Upvotes: 0

Related Questions