I fell in love with PhpStorm only few months ago ago when I switched from NetBeans, my favorite IDE by then. One thing that I was missing from the very start is the ability to separate project metadata (.idea/ directory) from sources, because I like to keep away everything that is unnecessary from my project directory, as well as from the .gitignore file. It turned out that something like that is possible, but in contrast to NetBeans it's not so evident and requires a little more effort:

  1. Create new project in a directory where you would usually keep metadata Create new project
  2. Open Settings / Preferences dialog and click on Directories node Settings - Directories
  3. Click Add Content Root button and select project sources directory Select content root
  4. Remove content root that keeps project metadata Remove meta content root

That's it, your project won't contain irrelevant .idea/ directory, therefore no need for git-ignoring it.