intellij IDEA中每个模块的不同存储库 [英] Different repositories for each module in intellij IDEA

查看:702
本文介绍了intellij IDEA中每个模块的不同存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道如何为我的IDEA项目中的每个不同模块选择不同的git repo,我没有看到任何选项,所有git选项似乎只与一个git repo有关。 / p>

是否有区分它们的方法?,所以:



(全部在同一个项目中)

>

模块A - >回购A
模块B - >回购B



?。



编辑:

每个目录有不同的VCS根目录。所以在你的情况下,为每个包含模块的目录定义一个VCS根目录。您应该删除VCS条目< Project> ,并为各个模块添加条目,使其看起来像这样:



如果您有文件然后打开 CTRL + K 或以其他方式打开提交对话框,所有更改的文件都将被选中,当您提交更改时,具有相同消息的新提交将会在所有包含更改文件的存储库中创建。



如果您只想从单个模块提交文件,请在提交对话框中手动选择它们或右键单击您的模块,转到Git并选择 Commit Directory


$ b 要按提交按 CTRL + SHIFT + K ,你应该看到类似的内容(注意这两个模块都包含在内)。

//i.stack.imgur.com/ByNoA.pngalt =推送对话框>

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 relate to one git repo.

Is there a way to differentiate them?, so:

(All inside the same project)

Module A -> repo A Module B -> repo B

?.

Edit:

解决方案

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 <Project> and just add entries for individual modules so that it looks something like this:

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).

这篇关于intellij IDEA中每个模块的不同存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆