I currently have two projects, a framework and an application. The repository for the framework contains a number of directories that are not useful in the application. I’d like to be able to configure git submodule to only copy the directories I want from my framework repository to the root of my application directory.
Here’s what my project directories look like:
Framework
- /
- red-locomotive/ – the framework i want to use
- modules/ – a directory with extra modules
- lib/ – libraries that the engine depends on
- examples/ – some tests
- readme.md etc…
Application
- /
- red-locomotive/ – from framework
- modules/ – from framework
- lib/ – from framework
- kernel.js etc…
You can see that I want the three directories from the framework repository in the root of my application. can git submodules do this?
Nope. The submodule will clone the entire repository that it points to. Also you cannot delete any folders from a submodule so there is no way to modify it after including it.
Where I work we have found modules to be quite a pain. Every time you redeployment ( depending on your method) you have to go over every submodule and re initial / add it. We tried to use it for our open source additions like tinymce and tcpdf but pitched that method.