Intellij - 在多个 git 本地分支之间切换

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13797331/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 07:53:14  来源:igfitidea点击:

Intellij - switching between multiple git local branches

gitintellij-idea

提问by sebi

I am using Intellij on a project with multiple modules. I have started a big refactor and created local branches for 3 modules. Each branch has the same name. Currently, I have to checkout each of them (for each module, that is). Is there a way to do a global checkout? Or to create a single branch for all modules? Thanks.

我在具有多个模块的项目中使用 Intellij。我已经开始了一个大的重构并为 3 个模块创建了本地分支。每个分支都有相同的名称。目前,我必须检查它们中的每一个(对于每个模块,即)。有没有办法进行全局结帐?或者为所有模块创建一个分支?谢谢。

回答by LoKi

Just go to Settings | Version Control | Git and select "Control branches from different roots synchronously", and all operations on branches (VCS -> Git -> Branches) will be performed for 3 repositories at once.

只需转到设置 | 版本控制 | Git并选择“同步控制来自不同根的分支”,所有对分支的操作​​(VCS -> Git -> Branches)将同时对3个仓库执行。

See details in this blogpost.

请参阅此博文中的详细信息。

Also make sure that all 3 modules are correctly registered in the roots table in Settings | Version Control.

还要确保所有 3 个模块都在 Settings | 的 root 表中正确注册。版本控制。