How to gitignore .idea files

The links in the old posts explaining this are obsolete. 

How do I ignore the .idea files?

Step by step please.. 

Simply telling me to add them to gitignore is not going to help me. Where is gitignore? Do I have to create a gitignore 'file'? Where do I create it? Do I have to create it in every repo I use with rubymine?

Comment actions Permalink


.gitignore file is usually placed at the root of your repository. The general documentation you can find here:

Comment actions Permalink

Your personal dev tools-related git exclusions (related to YOUR O.S., YOUR editor/IDE, YOUR <whatever>) shouldn't pollute the shared `.gitignore`.

I store mine is `~/.gitignore_global`


# file: ~/.gitignore_global

Comment actions Permalink

Go to File > Settings > Version Control > Ignored Files 

then add your folder or file to git ignore.

hope it helps.

Comment actions Permalink

See this link for suggested contents of a global JetBrains .gitignore file, which you could prune to work for your own case.

If unfamiliar with github, you'll need to click the `raw` button above the file if you want it in an easy to copy-paste format without the line numbers and frame.

Comment actions Permalink

|   Go to File > Settings > Version Control > Ignored Files 
|   then add your folder or file to git ignore.

To be clear, these are two separate steps.  The "Ignored Files" in the first step is an internal ignore list maintained by PHPStorm, separate from GIT.  If you use this function, it WILL lead to errors if you use any other kind of git client on your machine.  JetBrains really needs to change the name of this menu item/function to reflect that it has nothing to do with ignoring the file at the version control level. It ONLY controls whether PHPSTorm will recognize it.  It will still remain in your GIT repo, but simply not display in the PHPStorm interface.  Very confusing.

So when this person says "then add your folder or file to git ignore" he's basically saying, no there's no way for PHPSTorm to handle this for you. You have to do it manually.


Please sign in to leave a comment.