.gitignore and .idea/workspace.xml



Can someone please tell me how to ignore the .idea/workspace.xml file?


Comment actions Permalink

Hello John,

Just add '.idea/workspace.xml' to the .gitignore file.

If you have already committed the file, then ignoring won't have any effect. You have to remove the file from the repository first:
git rm --cached .idea/workspace.xml

Comment actions Permalink



Comment actions Permalink

I am trying to ignore workspace.xml in both Rider and Webstorm

In my Webstorm .gitignore I put the .idea/workspace.xml and that works perfectly.

However it does not work for Rider because the file is buried in multiple .idea directories.

I've tried everything to get rid of this damn file, to no success.

How can I ignore it please ?

Comment actions Permalink

I think I was too hasty to send you to Rider. Would */.idea/workspace.xml work or you?

The previous message where I was hasty:

It makes sense to ask the Rider support about that: https://rider-support.jetbrains.com/hc/en-us/requests/new?ticket_form_id=97145

This is a PhpStorm forum branch, we don't have multiple .idea folders.
Comment actions Permalink

Hello Anthoni,

Please make sure that you put ".idea/workspace.xml" in the corresponding .gitignore file which cover all your ".idea" directories.
In other word: all ".idea/workspace.xml" files should be child of one parent directory which contain .gitignore. Otherwise you should create another .gitignore in most top-level directory of the project.   

Comment actions Permalink

Hi Dmitry,

It never occurred to me that I could put another .gitignore file inside the lower .idea folder and the have that just ignore the workspace.xml file.

Thank you. I am kinda new to the whole git version control, but I am getting there.


Please sign in to leave a comment.