24

How can I setup git in Intellij to have different git repositories for each module in 1 project.

I have an API I am maintaining and my fork of an Open Source project as 2 different modules in 1 intellij project. I would like each module to push/pull with a different git repository.

4

3 回答 3

45

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.

于 2013-03-31T02:15:50.167 回答
7

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" />
于 2019-12-10T23:13:10.040 回答
3

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

于 2017-06-16T19:13:02.787 回答