Hello,
My situation:
I've recently joined on the front-end side of an established project that involves a growing number of instances of a rails app, each of which which differ in some aspects (views, styling, settings etc) but which all share the majority of their back end code.
Our Git repo has a number of branches looks something like this:
master
apple
banana
cherry
...
strawberry
tangerine
...
Where each fruit-derived branch is holds the production code for a production instance.
(Master isn't used for a live deployment but contains all the shared code and is what we'd clone from to set up a new instance.)
My problem:
Work specific to a single instance is simple enough, taking place in that in branch (or a dev branch of it) etc etc...
However, if I need to make a change that will affect all the sites in the cluster I do that at the moment in a dev branch and merge it into master, and then (what's bugging me) have to manually check each production branch out in turn and merge master into it.
Even my humble code monkey brain can see that this does not scale well.
At the moment we have something like 8 production branches, so it's not that bad, but the plan is for growth and by the time this gets to even 20 (let alone 50+) it's going to be a serious pain. It's also going to be my personal pain, as I'm the one who is likely to be dealing with it on a day to day basis.
So, my actual questions would be:
- Is there something in the core git functionality that I'm missing that will let me elegantly merge from master into n other branches in one fell swoop? (unlikely I think, but worth the ask nonetheless)
- Alternatively, might there be a way to do this with crafty some shell scripting? (of which I might add, I know very little, and understand even less)
If the latter of these can anyone help me get started/point me in the right direction?
Many thanks in advance for your time and help.