1

Suppose I have 2 features to be delivered (A and B). I have two primary branches (develop & master) for staging and production servers and 2 feature branches (features/a and features/b). When a feature is ready, I merge it to develop branch for testing. Let's assume that there wasn't found any bugs in feature A but there are some bugs in feature B, so I can't merge develop to master since feature B requires some fixes. But I need to deliver features that are ready (A in this case), so this approach doesn't work here. What other approaches can I try? I cannot switch branches for testing server because each feature may change the database schema, and I cannot always revert schema changes. I also cannot recreate database every time because I lose all the test data added manually by testers.

2
  • To clarify, you merge features/a or features/b into develop before the feature has been tested?
    – mmathis
    Commented Jun 6, 2017 at 19:31
  • It has been tested locally by developers and unit-tests and was merged to deliver it to the staging server for testers
    – Random
    Commented Jun 6, 2017 at 19:42

1 Answer 1

2

In case there are no dependencies between the developed features you can use git cherry-pick to merge the commit(s) of one feature branch to the final master branch.

However, you should consider to introduce release branches to decouple the development branch from the master branch to avoid any misplaced/unpleasant commits in the final master branch.

Hence the workflow would be, developing in feature branch, merge to development branch, verifying, if okay, merge to release branch, if not okay, fix on feature branch. Finally, merge from release branch to master branch.

A release branch is also useful when some new features are ready which are not part of the current release but part of the next release. Then you have a release branch for the current release and one for the next release.

2
  • Thank you. But what should be the parent of release branch? And how would it solve the problem of separate delivering features A and B?
    – Random
    Commented Jun 7, 2017 at 7:38
  • The parent of the release branch is the master. You are just merging working features, which were validated on the development branch, to the release branch. For example you validates Feature A works but Feature B not on the development branch, then you merge Feature A to the release branch and not Feature B. Commented Jun 7, 2017 at 15:03

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.