简体   繁体   English

GIT 问题中的 PhpStorm.idea

[英]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.为了使每个团队成员的代码样式保持一致,我们的项目将 PhpStorm 配置文件作为 GIT 的一部分。

Conditions条件

VCS contains config files in.idea. VCS 在.idea 中包含配置文件。 Files list:文件列表:

  • codeStyles/codeStyleConfig.xml
  • sqldialects.xml
  • inspectionProfiles/Project_defaults.xml ; inspectionProfiles/Project_defaults.xml

Problems问题

  • The project root directory is shown empty;项目根目录显示为空;
  • Indexation problems (the indexation process never finishes)索引问题(索引过程永远不会完成)
  • Trees display errors (files are not shown in some directories, always "loading files...")树显示错误(文件未显示在某些目录中,总是“正在加载文件...”)

Workaround解决方法

If I delete the entire .idea folder with the files in it and PhpStorm reinitializes the settings, everything seemingly works fine.如果我删除包含文件的整个.idea文件夹,然后 PhpStorm 重新初始化设置,一切似乎都正常。

Have anyone else encountered something similar?有没有其他人遇到过类似的事情? What can you recommend?你能推荐什么?

You should ignore all user-specific config files.您应该忽略所有用户特定的配置文件。 Below is the recommended file list that should be added to the .gitignore以下是应添加到.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 commit them如果 git 上还有一些文件,你应该删除它们并提交它们

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

Yes, that the known problem when .idea folder is present and not empty but does not have all needed files.是的,当.idea文件夹存在且不为空但没有所有需要的文件时的已知问题。

https://youtrack.jetbrains.com/issue/IDEA-271728 -- watch this ticket (star/vote/comment) to get notified on the progress. https://youtrack.jetbrains.com/issue/IDEA-271728 - 观看此票(星号/投票/评论)以获取有关进度的通知。


What can you recommend?你能推荐什么?

Sadly got nothing significant to suggest from my end.可悲的是,我没有什么重要的建议。 I simply do not face such problem (can manually workaround it).我根本没有遇到这样的问题(可以手动解决它)。

The only thing I may suggest:我唯一可以建议的是:

  • Make a new project without .idea folder in it.创建一个没有.idea文件夹的新项目。

  • Once the project is made, close it in the IDE and overwrite those files (a simple copy-paste will do).项目创建后,在 IDE 中将其关闭并覆盖这些文件(简单的复制粘贴即可)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM