不能忽略.idea / workspace.xml – 不断popup
使用PHPStorm,我试图忽略每次尝试进行git提交时popup的workspace.xml 。 
 我的.gitignore看起来像: 
 /.idea/ .idea/workspace.xml 
因为在文件被提交的时候,我也执行了:
  git rm --cached .idea/workspace.xml ,然后提交删除,推送到裸露的回购。 
但是当我在项目中进行更改时,文件会一直popup。
任何想法,我失踪?
我面临同样的问题,它把我推上了墙。 这个问题最终导致.idea文件夹被ALREADY先前提交到repo中,所以他们被git跟踪,无论你是否忽略它们。 在closuresRubyMine / IntelliJ或任何你正在使用的IDE之后,我会推荐以下内容:
 mv .idea ../.idea_backup rm .idea # in case you forgot to close your IDE git rm -r .idea git commit -m "Remove .idea from repo" mv ../.idea_backup .idea 
确保在.gitignore中忽略.idea
尽pipe在存储库的.gitignore中忽略它就足够了,但我build议您忽略全局的IDE的点文件。
否则,您必须将其添加到每个.gitgnore中,以便处理每个项目。 另外,如果你与其他人合作,那么最好的做法是不要污染项目的私人configuration,而不是特定于项目源代码。
 我刚刚有这个问题,我不得不做git rm -f .idea/workspace.xml现在它似乎已经不存在了(我也必须把它放到.gitignore ) 
在你看到该文件出现在相同的目录中做:
-  
rm .idea/workspace.xml -  
git rm -f .idea/workspace.xml (as suggested by chris vdp) -  
vi .gitignore -   我 (编辑),添加
.idea/workspace.xml中的一行, Esc ,:wq 
你现在应该很好
我不得不:
- 从git中删除文件
 - 推送到所有遥控器
 - 确保所有其他提交者从远程更新
 
命令
 git rm -f .idea/workspace.xml git remote | xargs -L1 git push --all 
其他提交者应该运行
 git pull 
只要告诉git不要以为它改变了就不要紧:
 git update-index --assume-unchanged src/file/to/ignore 
是的,你可以从git仓库中删除这些文件。 但是,如果你的团队都使用相同的IDE,或者你自己,你可能不想这样做。 对于你自己,你想要有一个好的起点恢复工作,对于你的队友也是如此。
 如果你的git .idea/workspace.xml有多个项目 , .idea/workspace.xml将不匹配任何文件。 
相反,请执行以下操作:
 $ git rm -f **/.idea/workspace.xml 
让你的.gitignore看起来像这样:
 # User-specific stuff: **/.idea/workspace.xml **/.idea/tasks.xml **/.idea/dictionaries **/.idea/vcs.xml **/.idea/jsLibraryMappings.xml # Sensitive or high-churn files: **/.idea/dataSources.ids **/.idea/dataSources.xml **/.idea/dataSources.local.xml **/.idea/sqlDataSources.xml **/.idea/dynamic.xml **/.idea/uiDesigner.xml ## File-based project format: *.iws # IntelliJ /out/ 
我在Android Studio中所做的也是基于IntelliJ的方式就是这样。 在提交对话框中,我还原了workspace.xml的更改,然后将其移至未版本化的文件。 之后,我从提交对话框中删除了这个。 现在它不会出现在更改列表中。 请注意,我的gitignore已经包含.idea / workspace.xml
 忽略以.iws结尾的文件,以及.gitignore 参考中的workspace.xml和tasks.xml文件