Should we be using Git submodules?

Hi devs,

With the caveat that I am not a developer, I was asked a while back why we weren’t using Git submodules for things like our API, webapp, etc.

After looking at I saw that @raff did some investigation about submodules last year in 2013. Issue RA-15 also calls for looking into use of submodules.

I didn’t have a good answer, so wanted to ask here: Should we be using Git submodules? What do you think? Add your comments in this thread.

Some overview reading:

Hey Michael,

I just discovered git submodule reading your post and pointers, so thanks a lot ! :+1: .

I’m only a student and I’ve not enough experience with OpenMRS development or OpenMRS modules to give my point of view, or if it can be useful for us.

Moreover, I’ve personal repo that looks perfectly suited to test submodule. And I think using submodule will make my job easier :smirk:.

I’ll try to test it (according to my :calendar: ), and then give you my feedback. :clipboard:


1 Like

Well, in ID-Dashboard, @elliott already have used the concept of submodule. However, it’s a different approach. That is, .gitignore the submodule folder, and clone the submodule repo into this folder.

This indeed make things easier. So I think, since there is a official way to do that. We’d better use it.

After some searching… I found it seems not so charming.


Good point @plypy. However, the reason we chose not to use git submodules in OpenMRS ID is that Dashboard modules add additional functionality, rather than providing code that the main repo depends on. My understanding with git submodules is that they’re meant for treating separate repos as dependencies.

In regards to the OpenMRS platform, isn’t it best practice in Java/Maven to separate all components and pull them together in the pom?