Search code examples
gitprojectproject-structure

Optimize the use of Git to manage projects related with a common origin and repository


This is my current situation:

I am developing an online course platform in PHP.

The core of the platform is in a server folder called platform.
The frontend of each course (html, javascript, images, etc ...) is in its own folder, for example: www.curso1.com, www.curso2.com, etc ... and have an include of the core of the platform.
Each course has its own front-end elements, but also templates that are similar to each other courses.

Current git configuration:
The core is managed with a Git repository called platform with its branches develop and master.
All the courses front-end are in a Git repository called courses, but, for each one, I have created a branch course1/develop, course1/master, course2/develop, course2/master, etc..

Issue: There is a folder (Templates) in the courses that contains templates that adapt slightly to each course but most of the code is shared among them. When I fix small errors in a template, I fix them on a new branche course1/fixtemplatebug of course1/develop and I make a merge with course1/develop and/or course1/master. But I have to propagate those changes manually in the other courses using some 'diff' tool like WinMerge or similar.

Question: Since all the courses have a common repository, using Git: Is there any way to propagate those 'fixes' to each course without losing the adaptations of each course in their templates?


Solution

  • The easiest thing to do here might be to just fix minor template errors in the parent developer or master branch in your platform repo. Then, rebase or merge each course feature branch on this single parent branch. This way, you only need to make a single commit to fix the template problem. You should would have to do legwork to bring that change into the course branches. But you should expect to have to do some work to fix a bug.