I have excluded .idea/
folder in perferences, but when I try to commit changes, phpstorm tries to commit workspace.xml file. Why?
Asked
Active
Viewed 3,939 times
3

ozahorulia
- 9,798
- 8
- 48
- 72
-
possible duplicate of [User related files in IntelliJ IDEA project](http://stackoverflow.com/questions/13622433/user-related-files-in-intellij-idea-project) – CrazyCoder Dec 07 '12 at 14:32
2 Answers
8
For what I see, .idea/workspace.xml
seems to be deleted, so it means it was previously tracked by git.
EDIT: You have accidentally committed this file, so you want to remove it from the repo but not from your working copy.
For this you have to use the --cached
flag of git rm
:
$ git rm --cached .idea/workspace.xml
From git help rm
:
--cached
Use this option to unstage and remove paths only from the index. Working tree files, whether modified or not, will be left alone.
You'll have to commit the deletion if you want the file to not be included in the repository code anymore.
Instead, if you want to leave the file there but stop tracking further changes to that file, you should use git
's assume-unchanged
option.
From the command line, that's like:
$ git update-index --assume-unchanged .idea/workspace.xml
I don't really know how to do that with the GUI you're using.

mgarciaisaia
- 14,521
- 8
- 57
- 81
-
I could accidentally commit this file, yes. I need to remove it from git rep, but I can not remove it localy: this file is a configuration file of my IDE. – ozahorulia Dec 07 '12 at 14:43
-
@Hast OK; I've updated my answer to issue this new info. I hope this helps. – mgarciaisaia Dec 07 '12 at 15:17
-
I'm running OS X, so it's not difficult to use command line :) But it doesn't work. It says: `fatal: Unable to mark file .idea/workspace.xml` – ozahorulia Dec 07 '12 at 17:05
-
on your screenshot it looks like it was already marked as deleted - see what is commit about, only deletion – lupatus Dec 08 '12 at 12:53
1
The answer was: simply add .idea/
to .gitignore file in the root of my application.

ozahorulia
- 9,798
- 8
- 48
- 72