We have the following setup: three applications that are similar to each other with common code extracted into the framework. Each application is managed in its own git repository and includes the framework as a submodule of git.
The problem is that applications are now being developed in parallel with the addition of new features to the infrastructure that other applications do not need to support immediately. We currently have different areas of the structure for all applications. One application uses the main branch of the framework because most of the time, new features were first introduced in this application.
Frame branches
- master (using App A)
- Appb
- APPC
When a new function appeared in appB that needed changes in the structure, these changes were made to the appB branch. If these changes were later needed in Appendix A, the appB branch was merged with the wizard. This means that all changes to appB should have been merged into master.
This system worked, but had some drawbacks.
- merging a function from one branch to another meant that we had to merge all the changes
- itβs easy to lose information about what has already been merged or what will be merged when merging one branch into another
- Noting the changes in the gap, it was done using commit messages, which made the last point even more important.
We are currently looking for a new workflow. I was thinking about having the following branches
So, for each application, there is one branch and a leading branch, which includes all the changes. When new functions are developed, it is necessary to create a functional branch, and then apply it both to the wizard and to all application branches that are needed immediately. Other applications may combine the function branch when they need the function later.
I see the following problems with this
- How can I merge a function branch into several branches and only merge the changes that occurred in the branch. I know "git rebase on ...", but I'm not quite sure if I can use this command several times.
- Should I use git cherry pick to combine functions in multiple branches? I would prefer not to do this because I can think that it will be susceptible to errors if you do not select all the changes made to the property branch.
- How to track which function (branch) was applied to which application. Can I use the --no-merge branch or will it only work if the branches have the same ancestor?
I believe this is the best way to achieve this, or should I completely rethink my strategy?
source share