在IntelliJ IDEA的现有项目中添加GIT支持 [英] Adding GIT support to existing project in IntelliJ IDEA

查看:786
本文介绍了在IntelliJ IDEA的现有项目中添加GIT支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有使用Maven构建的多模块项目。我从IDEA项目中只导入了该项目的单个子模块(不是父项),看起来像IDE不能识别.git文件夹(因为它比我用来导入的项目根目录高一级,我猜)



是否仍然有可能以某种方式为intelliJ添加Git支持?

解决方案

我已经成功地在IDEA中打开了一个Maven子项目。当然,它并未自动启用Git集成。从VCS菜单中,我选择了启用版本控制集成并从子菜单中选择了Git。

然后,IDEA抱怨项目中没有.git文件夹,并提供选择父.git文件夹。我做到了,一切按预期工作。



如果您在VCS菜单中没有Git选项,这可能是一个错误。尝试禁用SVN插件,看看是否有帮助(我的IDEA中没有SVN插件)。


I have multi-module project built with Maven. I imported only single sub-module (not parent) from that project as IDEA project, and looks like IDE doesn't recognize .git folder (because it is one level up from project root I used to import, I guess)

Is there still a possibility to add Git support for intelliJ somehow?

解决方案

I have successfully opened a Maven subproject within IDEA. Naturally, it hasn't enabled Git integration automatically. From VCS menu I have selected "Enable Version Control Integration" and chose "Git" from submenu.

Then IDEA complained that there is no .git folder within the project and offered to select parent .git folder. I did it and everything worked as expected.

If you don't have Git option in VCS menu, this might be a bug. Try to disable SVN plugin and see if that helps (I don't have SVN plugin in my IDEA).

这篇关于在IntelliJ IDEA的现有项目中添加GIT支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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