Adding GIT support to existing project in IntelliJ

2019-02-02 21:21发布

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?

6条回答
\"骚年 ilove
2楼-- · 2019-02-02 21:38

In my case, I was not able to get Intellij to detect Git on the module. So I removed the module from the project and re-added it. That time it was detected and I could use the Git menu.

查看更多
我欲成王,谁敢阻挡
3楼-- · 2019-02-02 21:42

Consider using Git outside of the IDE. There are great efficiencies to be gained from the command line in Git.

查看更多
Bombasti
4楼-- · 2019-02-02 21:48

Not sure if it's helpful to anyone else, but in my case, we had recently upgraded from CVS to GIT (gasp). There were some old CVS specific files in the project (i.e. .cvsignore) that must have indicated to IntelliJ that this was a CVS project. I had to manually remove this file for IntelliJ to recognize the new .git folder and related files.

查看更多
爷、活的狠高调
5楼-- · 2019-02-02 21:50

You may need to add git to the list of version control in the settings

settings > Version Control

then make sure that git is listed in the table as a VCS

I had to do this otherwise git wasn't listed in the VCS menu in the menu bar.

Make sure Git is in one of the columns here

查看更多
手持菜刀,她持情操
6楼-- · 2019-02-02 22:01

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

查看更多
啃猪蹄的小仙女
7楼-- · 2019-02-02 22:01

If your issue is that the Version Control tab is missing use View/Tool Windows/Version Control.

This will bring the Version Control window into the bottom frame, provided all the remaining pieces of your git configuration are correct.

查看更多
登录 后发表回答