So I have my main repository and as a backend
I want to add submodules which are repositories I don't have write access to. However I want to be able to keep on pulling from the mainstream.
I want to add a plugin to one of those backends
that reside as a submodule, and to do that the plugin code must be placed inside the backends/foo/src/
directory of my submodule. At the same time I want to keep my backends/foo/src/plugin
as a part of my main repo.
Is there a way to do that with github
?
No. Once you make backends/foo
a submodule, you basically hand over control of that directory to the other repository.
You could use some build system magic to copy files around, or fork the remote repo, add your plugin, then use that as the submodule instead.
However, the best thing to do would probably be to take a close look at the submodule and figure out a way to build plugins out of their source tree. If you have to hack their build system to be able to do it the odds are good that they would accept a patch.