1
votes

JetBrains help says:

All the settings files in the .idea directory should be put under version control except the workspace.xml, which stores your local preferences. The workspace.xml file should be marked as ignored by VCS.

But all large GitHub projects exclude .idea from version control in .gitignore. So what is the right way to store IDE project settings (directories, inspections) on GitHub? It would be nice to see an example of such repository.

1
They exclude such files because they following the general idea that code should be independent of the IDE used to developed it. Plus, if it's a open-source or public repository then anyone can use it .. so why do they need your IDE settings if they will use Notepad/vim/etc to edit it (if they need to edit, of course)? Also -- you do not need some IDE settings to actually use that code (to run it).LazyOne
All that text above means .. that it only makes sense to keep your IDE settings in the same repository as your code if it's a private project/repository and all of your team members (or at very least majority) are using the same IDE.LazyOne

1 Answers

2
votes

https://github.com/github/gitignore is a collection of .gitignore templates, including template for JetBrains IDEs. Although this template is not written entirely according to the JetBrains' advice, you can base your work on it.

Meanwhile, there have been a few open pull requests which attempted to fix the .idea directory issue (#1475, #1399 and #1509). You can take check them out as well.

Update
#1475 has been merged.