I use Rubymine for Rails projects. Very often, Rubymine makes changes in .idea/*
files that I don\'t care about. But it keeps preventing me from checking out ne
While it's not been too long that I made the switch to Rubymine, I found it challenging ignoring .idea files of Rubymine from been committed to git.
Here's how I fixed it
If you've not done any staging/commit at all, or you just spinned up a new project in Ruby mine, then simply do this
Option 1
Add the line below to the .gitignore file which is usually placed at the root of your repository.
# Ignore .idea files
.idea/
This will ensure that all .idea files are ignored from been tracked by git, although they will still remain in your project folder locally.
Option 2
If you've however done some staging/commit, or you just opened up an existing project in Ruby mine, then simply do this
Run the code in your terminal/command line
git rm -r --cached .idea
This deletes already tracked .idea files in git
Next, include .idea/ to the .gitignore file which is usually placed at the root of your repository.
# Ignore .idea files
.idea/
This will ensure that all .idea files are ignored from been tracked by git, although they will still remain in your project folder locally.
Option 3
If you've however done some staging/commit, or you just opened up an existing project in Ruby mine, and want to totally delete .idea files locally and in git, then simply do this
Run the code in your terminal/command line
git rm -r --cached .idea
This deletes already tracked .idea files in git
Run the code in your terminal/command line
rm -r .idea
This deletes all .idea files including the folder locally
Next, include .idea/ to the .gitignore file which is usually placed at the root of your repository.
# Ignore .idea files
.idea/
This will ensure that all .idea files are ignored from been tracked by git, and also deleted from your project folder locally.
That's all
I hope this helps
I tried to added those files into my .gitignore
and it was useless...
Nevertheless, as Petr Syrov said, you can use git rm -r --cached .idea
into your terminal and those files won't be a problem anymore!
For me there was only one solution to remove .idea folder than commit file .gitignore with ".idea" and than use IDE again
Add .idea/*
to your exclusion list to prevent tracking of all .idea files, directories, and sub-resources.
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.
JetBrains has a .gitignore_global
on GitHub.