Arguments for NOT adding the entire “.idea” folder to .gitignore/.hgignore

Answered

I know, I could google it but I have not found anything concise and of a corresponding quality on that topic. Personally I only add .idea/workspace.xml to my .gitignore. But there are so many reasons adding the entire .idea folder to the SCM instead ignoring it. Maybe you create yourself a site and added “adding .idea to .gitignore” as an anti-pattern?

Apparently this pattern comes from the dark Eclipse times as adding project meta-data was a clear anti-pattern as Eclipse was using absolute paths all over (maybe still does).

0
2 comments

I’ve compiled a list myself…

The disadvantages of not using IntelliJ project meta-data inside your SCM (Git/Mercurial/Subversion):

 

  • correct Spring configurations need to be setup manually by everybody on your team
  • Run configurations need to be setup manually by everybody on your team
  • auto-import of build.gradle sometimes fails with an exception and a project needs to be configured manually
  • in most real world cases a correct Spring configuration is not provided after an initial project import
  • folder excludes need be configured by everybody on your team
  • the huge commit of IntelliJ’s project meta-data is a one-time issue, also the number of files should not be a pro or contra issue for anything
  • if everybody is running the same major version there should not be any issues, even when IntelliJ v15.0.0 opens a v15.1.4 project
  • for a new team member who needs to open 20+ projects on a “migration day” the auto-import takes significant 
  • sharing common indentation, code style settings, and copyright headers is not possible in a convenient way
  • switching between branches requires in some cases a complete project re-import

Those are the real world problems people might face when not committing user-independent project meta-data to a project’s SCM.

1

Please sign in to leave a comment.