5

I had not heard of this file until I randomly checked git status in an old repository and there it was, a file I had not edited myself nor ever seen before. I do not know how it got there.

It seems it's common asked about - mostly how to remove it (e.g. here and here).

What is this file, and what created it?

stevec
  • 41,291
  • 27
  • 223
  • 311
  • `.idea` is generally created when you are using Rubymine IDE. – Arup Rakshit Jul 18 '19 at 09:57
  • @ArupRakshit I have never heard of Rubymin. I guess it’s possible I used it briefly for something as the repo has been untouched for some months – stevec Jul 18 '19 at 09:59
  • You can also check if it's not somebody else that forgotten to gitignore his IDE config file and added it to the repo – cercxtrova Jul 18 '19 at 10:05
  • Is it strictly a ruby thing? I have found references to 'Jetbrains' elsewhere on the web. I found .idea/workspace.xml inside a rails app, but I also use pycharm which is made by jetbrains, so I wonder if I mistakenly made the file with pycharm (a python IDE). – stevec Jul 18 '19 at 10:10
  • I strongly suggest ignoring .idea/workspace.xml, if it is already in the repo and keeps popping up, follow this https://stackoverflow.com/questions/19973506/cannot-ignore-idea-workspace-xml-keeps-popping-up The reason for ignoring this particular file is that it changes all the time for all possible reasons, including elapsed time.You don't want to see it every time you do any kind of a merge. – Do-do-new Aug 25 '19 at 08:47

1 Answers1

7

.idea is the dir for saving the project configurations for all Jetbrains IDES (RubyMine , Pycharm , PHPStorm , WebStorm ..etc)

you can handle it using two ways if you don't want to commit it to the repo

Ignore it only for yourself

in .git/info/exclude

add /.idea

Ignore it in .gitignore so it will be ignored for everyone who uses the repo

by adding /.idea to .gitignore

if the dir .idea already tracked by git you will need to remove it first from the cached files before ignoring by git rm -r --cached .idea

This folder can include important configuration if you did any custom configuration for the project and also include the indexed data for the IDE which helps it to provide quick autocomplete and in certain cases would be better to commit it to the repo but I always ignore it because the other developers in the team don't use RubyMinee

M.Elkady
  • 1,093
  • 7
  • 13