Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rubymine: How to make Git ignore .idea files created by Rubymine

Tags:

git

rubymine

People also ask

Should .idea folder be ignored?

ignoring the idea folder is fine as not everyone uses them, and they are not part of your code - you (hopefully) don't need them on production, for instance. ignoring is fine, but removing is less of a good idea. It contains information for your local workspace. I'm surprised this is down-voted.

Should I commit .idea folder to Git?

It's recommended not to commit all the . idea folder because it's for configurations.


Try git rm -r --cached .idea in your terminal. It disables the change tracking.


just .idea/ works fine for me


Note that JetBrains recommends "If you decide to share IDE project files with other developers...", tracking all the .idea/* files except for the following:

  • workspace.xml
  • usage.statistics.xml
  • tasks.xml
  • the shelf/ directory

So to follow their advice, you would add those to your .gitignore.


Source:

If you decide to share IDE project files with other developers, follow these guidelines:
...
Here is what you need to share:

  • All the files under .idea directory in the project root except the workspace.xml, usage.statistics.xml, and tasks.xml files and the shelf directory which store user specific settings
  • ...

How to manage projects under Version Control Systems (archive)

There's some additional notes and discussion on that page that you should read if you're considering going ahead with this,
including additional files you may want to gitignore even if you decided you want to share IDE files (e.g. .iml files, .idea/modules.xml, gradle.xml, user dictionaries folder, additional files that are generated from gradle or maven).


Add .idea/* to your exclusion list to prevent tracking of all .idea files, directories, and sub-resources.


if a file is already being tracked by Git, adding the file to .gitignore won’t stop Git from tracking it. You’ll need to do git rm the offending file(s) first, then add to your .gitignore.

Adding .idea/ should work


using git rm -r --cached .idea in your terminal worked great for me. It disables the change tracking and unset a number of files under the rubymine folder (idea/) that I could then add and commit to git, thus removing the comparison and allowing the gitignore setting of .idea/ to work.