Search code examples
gitsymfonygit-submodulessymfony-3.1

Symfony & Git: Best practice for multiple websites


I'm developing a symfony 3 application to run websites for concert/ booking agencies. Now I wonder what would be the best practice to configure Git when I keep developing the app while I'm running multiple websites for different clients? The custom files that differ from project to project are located in different places and levels in the structure given by Symfony. In the diagram below they are labeled orange:

Symfony Project with custom files

So what would be the best approach to handle this with Git? Should I work with a repo for the core (excl. the custom files/ folders) and an additional repo for each client which uses the core repo as submodule? For the workflow the ideal conception would be, when I'd be able to work with the client repo and modify the core basis in order that new core features would be automatically applied to the other client websites.


Solution

  • The solution that worked for me was to move the custom views originally located in the FrontBundle to app/Resources and change the references in the Controllers. In this way it´s possible versionize the core in its own repo (marked green) and include it as a submodule in the repos of each client project.

    New structure including submodule

    Even though this solution works for now I´m curious what´s your approach to manage such problems.