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?



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


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


Go to File > Settings > Version Control > Ignored Files 

then add your folder or file to git ignore.

hope it helps.


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.


|   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.


Does not work anymore


It did work, just the UI seems misleading.  Actually , it is not misleading , it is just super slow and takes forever to update the UI. Bad user experience


@Yingdi1111, could you please specify your IDE version? Which delay was there in the UI refresh?


Where do I put the global .gitignore in Windows? %USERPROFILE%\.gitignore didn't do the trick.


Andreas Dau, have you configured it via

git config --global core.excludesFile

command? Could you please specify what exactly doesn't work and which output you get for

git config --global core.excludesFile

There is no Ignored Files under Version Control in IntelliJ IDEA.


This should be able to be accomplished by right clicking the file and choosing the correct item. What a GUI failure!


Builtin VCS Ignored FIles list has been deprecated in 2019.2 in favor of native ignores. Now the files should be ignored in a way provided by the VCS in use (e.g. .gitignore in git, svn:ignore properties, etc).
If a file hasn't been added to git then you can add file to gitignore by right-click on a file | Git | Add to .gitignore


Olga Kuvardina hints at it above, but the best explanation I found to set up a global ignore file is this github link 


The first thing I had to do is make sure the files I am adding to .gitignore are not tracked by git in first place.

git rm <file> --cached

Then intellij can work as expected.


Please sign in to leave a comment.