Different repositories for each module in intellij IDEA

后端 未结 3 1472
一向
一向 2021-02-04 05:08

I\'m not sure how to select a different git repo for each different module I have in my IDEA project, I\'m not seeing any option for that, all the git options seem to only relat

3条回答
  •  借酒劲吻你
    2021-02-04 05:42

    Go to Settings/Version Control, there you can configure different VCS roots per directory. So in your case define one VCS root per directory containing the module. You should remove the VCS entry and just add entries for individual modules so that it looks something like this:

    VCS config

    If you have files modified in several different repositories and hit CTRL+K or otherwise open the commit dialog all changed files will be selected and when you commit your changes a new commit with the same message will be created in all repositories containing the changed files.

    If you want to commit files from just a single module either manually select them in the commit dialog or right click your module, go to Git and select Commit Directory.

    To push the commits just hit CTRL+SHIFT+K and you should see something like this (notice that both modules are included).

    Push dialog

提交回复
热议问题