Setting up different git roots for different modules in same project - Intellij IDEA

File | Settings (Preferences on Mac) | Version Control dialog allows to map different directories to a version control, so just make several mappings instead of one, map each module root to Git.


It is much easier to edit the vcs.xml directly.

[project folder]/.idea/vcs.xml

The entries are like:

<mapping directory="$USER_HOME$/project_folder_a" vcs="Git" />
<mapping directory="$USER_HOME$/project_folder_b" vcs="Git" />

On a mac it's located at Intellij Idea-> Preferences -> Version Control