1

Hy,

I have three branches in GIT(master, manteinance and evolve). The manteinance is for fixing errors and evolve is for adding new features. If I am developing a feature in the evolve branch, the right order to do a merge would be?:

  1. From evolve to master
  2. From master to manteinance

If I had some fixes in the manteinance branch the right order would be?

  1. From manteinance to master
  2. From master to evolve

Thanks

1
  • master is the branch that you will be using for deploying. 1. If you are developing a new feature in evolve merge it with maintenance and then merge to master. 2. If you are fixing errors merge maintenance with evolve and then with master.
    – Vamsi Ravi
    Oct 22, 2015 at 20:12

1 Answer 1

1

The idea is to merge branches that needs to have a full history in common.
So a new feature in evolve can indeed be merged to master when ready.

But the merge from master to maintenance is a special one: it is about maintenance to be reset to master in order to reflect the new master, and record fixes from that point in time:

git checkout master
git merge --ours maintenance
git checkout maintenance
git merge master

And a fix in maintenance doesn't mean merging to master, since master might have received evolution which renders that fix not pertinent.
A cherry-pick from certain fixes from the maintenance branch to master (if needed) or to evolution is more appropriate.

4
  • Ok, but lets imagine(I think most of the cases) the client has a preproduction and a production environment so we finish the new features and we merge into master for deploying. The client installs it in its preproduction environment to check these features and at the same time discovers a bug in its production environment. We dont have a branch then which reflects the production environment because of the merging into master so shouldnt we merge into master untill the clients installs the applicacion with the new features in production environment? Oct 23, 2015 at 20:53
  • True, master should reflect prod only, not preprod. If you need a staging environment, you will need an additional branch to represent it.
    – VonC
    Oct 23, 2015 at 21:13
  • Ok, so I would use the evol branch for deploying and when the client installs it in its production environment I will do the merge into master. If the client discovers a bug in the meantime in its production environment, I could use the master to create new branch for resolving the fix. What do you think about it? Oct 23, 2015 at 21:23
  • 1
    Yes, making a fix branch from a master production state is a common practice.
    – VonC
    Oct 23, 2015 at 21:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.