user936965
user936965

Reputation:

Git submodule in multiple folders

I have a folder structure like this which I cannot change:

- root
-- craft
--- plugins
---- myplugin
--- templates
---- myplugin

At this moment everything is in a single repository. What I'd like to do is to create a submodule named "myPluginSubmodule" which contains both myplugin folders (from the plugin folder as well as the templates folder. Is this possible? If so, how can I achieve this?

Upvotes: 2

Views: 3496

Answers (1)

Nils Werner
Nils Werner

Reputation: 36835

This is not possible. If this is your own architecture I would suggest rethinking the concept, e.g. like

- root
-- craft
--- plugins
---- myplugin
----- src
----- templates

If it isn't your architecture my guess is there should be a mechanism to install and maintain plugins already in place.

Either way: using Git submodules for dependency/plugin management is not a good basis. Package managers exist for almost all common languages, and they exist for a reason: they can resolve nested dependencies or warn against conflicts, something Git inherently can't do.

Upvotes: 1

Related Questions