IntelliJ IDEA adopts a directory based model for version control association. A version control system is assigned to a project directory and/or additional directories that are part of or related to the project. Directories under version control are not required to be located under the project root. They can reside in any accessible location.
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.