I know there have been same question asked multiple times on the programmers stackexchange. I think my question is more specific and hence decided to start a new question.My current a project which has models, views and libraries (front-end and back-end both). My project directory structure looks something like:/php/libs/emailLib/php/libs/serviceLib/php/libs/databaseLib/php/services/Service1/php/services/Service2/php/services/Service3/php/services/Service4/js/module2/js/module1/models/Model1/models/Model2/models/Model3I have been using git to source control the current project. Now I'm about to start a new project which is independent of the current one but lot of code is which can be shared between new and the current project. I'm creating another repository for the new project. For libraries I can create a git submodule for libraries /php/libs. But the services are like few of them can be only be shared like service for translation can be shared but service for service for generating categories can't be shared (because my new project does not have anything to do with categories).How do I share the services? And there are few other such folders/programs(where only few of them shared among all).
How do I organizing 2 different projects with shared code
programming practices;version control;development process
Maybe you could create a third project on your source control, which contains only the shared libraries. So in short, your other two projects will reference this shared group of source files. This would allow you to have a group of shared libraries which are self contained, and are not stored within the context of another project. This assumes that you want to propagate any changes you make in the shared services of one application to another. If the above is not the case (you might want to do per project customizations), you could still create the third project as a shared structure, but once that you will have checked out your shared code, you would then include it with the current project and check it into its own repository. This would disconnect the shared code from its repository and would allow you to make per project customizations.If you see that certain features are being inserted into multiple projects, you could then edit your Vanilla shared folder structure and add the new files. This way, any new project which you will create will now have access to the new functionality without affecting your older project.