Adding GIT support to existing project in IntelliJ IDEA

前端 未结 7 1792
一生所求
一生所求 2020-12-29 03:00

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 fo

相关标签:
7条回答
  • 2020-12-29 03:29

    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

    0 讨论(0)
  • 2020-12-29 03:30

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

    0 讨论(0)
  • 2020-12-29 03:37

    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.

    0 讨论(0)
  • 2020-12-29 03:41

    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.

    0 讨论(0)
  • 2020-12-29 03:46

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

    0 讨论(0)
  • 2020-12-29 03:49

    Just delete .idea/vcs.xml and restart intelliJ

    0 讨论(0)
提交回复
热议问题