I have trouble wrapping my head around a very particular issue concerning a development setup for magento 2.
I have read a lot about using composer and git. It makes a lot of sense to NOT include the vendor directory and have each module, theme and custom project in separate repositories.
To explain my issue it is best I explain my workflow.
Currently I am working on a customer project. I installed magento and a couple of modules via composer. In addition I have my own set of custom modules I am developing while creating this project. Those modules of course reside inside the app/code folder. Some are project specific and will never be reused elsewhere. Those should be part of the project's git repository.
Others WILL be reused in other projects. Therefore I want them to have their separate repository. But since they are work in progress I cannot hook them into the project like all the other modules via composer (or can I?). It is actually the other way round, I will need to commit from this current project into the repository. And this process is likely to continue when I use those modules in other projects. These modules will continously be improved.
So what would this scenario look like? In the project's root folder I would have the main project with it's own remote repository. Let's say during the course of this project I have developed three custom modules inside app/code. How would I maintain those so they will be committed and pushed into each of their repository? Would I need to set up a repository in each of the modules folders? Would I have to cd in all of them and add/commit/push individually?
I fear I might loose oversight of the state of all the modules this way.
Let's say I finish this current project but in my next project I add new features I want in my first project as well. How would I "backport" those new features into past projects?
Practical insight welcome :)
Thank you