git submodule behavior in PhpStorm?

I'm aware that PhpStorm does not currently support git submodules, but I want to make sure I understand what exactly that means. I conducted a simple test and want to make sure I'm not missing something.

Is it correct to say that PhpStorm interprets git submodules correctly but that there is no interface to manage them?

I find it rather convenient to use the Command Line Tools Console to manage the submodules. For my quick test, I cloned a git project which has several submodules. I then updated them through the commandline tools console using my git alias. PhpStorm asked me if I wanted to add all the files to the main repository but I declined. I thought this is where things were about to go wrong, but I believe it was simply a false positive because once declined PhpStorm did not persist with wanting to add the files. Looking at the repository through PhpStorm, everything looks correct.  

Taking it one step further, I used the command line tools console to add a submodule to the repository. I was again confronted with a pop-up asking me if I wanted to add all of the new files to the repository. I once again declined. And again, PhpStorm appears to interpret everything correctly because it shows the .gitsubmodule file and submodule directory as local changes they need to be committed.

I'm assuming here that committing a submodule addition through the PhpStorm interface will create a reference and not actually add each individual file within that directory to the main suppository…correct?

Sorry for the long explanation but I just want to make sure I understand it correctly. It was (?) the only doubt holding me back from adopting PhpStorm is my new weapon of choice.



Also,  have a bunch of Unregistered Git root errors under Settings > Version Control (because of the submodules) Should I add them... ?


Hello Mark,

Currently PhpStorm can work with submodules, but only as with separate and independent Git repositories (optionally, nested in a super-repository).
For this you have to add submodule roots to the Settings | Version Control.

Update Project will perform fetch + merge from tracked branches for all registered repositories. But it won't call  `git submodule update`.
Commit Changes will commit the selected set of files to all repositories independently.
As I understand, ".gitmodules" file is updated by Git itself, anyway, we don't touch it.

In Push and Pull you can select repositories to operate on, same for all other operations like history.


So the question remains then, when will submodule support be added?

I am about to purchase PHPStorm for development as I've loved everything about it in the first 10 days of trial, however this one piece is rather important. I manage several Drupal projects with git, and using submodules is a critical part of managing the continuous update of the modules for each project.

EclipseIDE has full submodule support (and autodetection of submodules) - so it seems that this should be a fairly simple thing for a commercial IDE to implement?


Currently submodules support is not planned for IDEA 13. It may change though.


December 29, 2012 18:42... NEARLY 4 YEARS! 

This is essential to use PhpStorm with big projects!


It's because of this i have to have all in ONE BIG REPOSITORY.. for now it's grown to nearly ONE DAMN GIGABYTE of code

(I simply can't make my developers use the git console commands doing manual submodules right, because they don't get it ..)


I'd like to see the community push this topic forward. I absolutely have to agree with Gerd Christian. This is essential!

I also want to add, that this might not only be essential for big projects, but also for development of plugins in certain environments. For example I'd like to be able to have a project for a shop system which I develop plugins for and then use git submodules to be able to version my forked shop system as well as various plugins in one project. So technically this would become a big project, but it would only support development of the smaller ones (which depend on the whole project)


Please sign in to leave a comment.