我在Rails项目中使用Rubymine。通常情况下,Rubymine在.idea/*文件中做了一些我并不关心的更改。但它一直阻止我查看新的分支,并使我的.idea版本与我的同事不同。
我们已经向.gitignore添加了.idea/,但它会跟踪.idea中的变化。我该怎么做才对呢?
下面是我得到的一个典型的错误消息:
error: Your local changes to the following files would be overwritten by checkout:
.idea/workspace.xml
您可以使用gitignore进行高级gitignore文件生成。它是快速,简单和前沿标签自动生成为您。
使用这个链接的大多数jetbrains软件(intelij, phpstorm…)
Jetbrains .gitignore文件
(编辑)
下面是为Jetbrains软件生成的gitignore文件,这将防止您共享任何Jetbrains软件用于管理项目的敏感信息(密码,密钥库,数据库密码…)
# Created by https://www.gitignore.io
### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm
*.iml
## Directory-based project format:
.idea/
# if you remove the above rule, at least ignore the following:
# User-specific stuff:
# .idea/workspace.xml
# .idea/tasks.xml
# .idea/dictionaries
# Sensitive or high-churn files:
# .idea/dataSources.ids
# .idea/dataSources.xml
# .idea/sqlDataSources.xml
# .idea/dynamic.xml
# .idea/uiDesigner.xml
# Gradle:
# .idea/gradle.xml
# .idea/libraries
# Mongo Explorer plugin:
# .idea/mongoSettings.xml
## File-based project format:
*.ipr
*.iws
## Plugin-specific files:
# IntelliJ
/out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
生成的代码也有很好的注释。
希望能有所帮助。