2

For a new feature(enhancement), developer branches code from master branch and merge it after code review.

On release date, master branch is freezed (for code change/merge) for one day, and product release team branch a release branch from master branch and maintain that release branch, until release goes End of Support.

After product release, release branch will be used for production bug fixes, where a new bugfix branch is created from corresponding release branch for every production bug and code changes are merged in bugfix branch after code review.


Now, the problem is, master branch is not up to date with bugfix branch code.

Assume there were four releases in past 12 months.


How to update master branch immediately with bugfix branch code changes? done for every production bug fix..

Do we need to create PR(code review) for both bugfix branch and master branch? for every production bug...

overexchange
  • 15,768
  • 30
  • 152
  • 347

1 Answers1

3

You have two options, cherry-pick or merge. This answer goes into detail about cherry-picking, merge and rebase but you should probably ignore the rebase part because you cannot use it for your situation (you may not want to set the patch branch as the base of your master).

If you want to use cherry-pick, you can use the range option, explained in this answer.

If there are conflicts and these conflicts require complex changes, PR is a very good idea.

Personally, I would go with the merge option because it is easier to manage and track the source of the changes. But ultimately it depends on your needs and business practices.

While you are at it, you can take a look at this document about git feature branch workflow. Your whole patch branch sounds like a huge feature branch or bugfix branch.

Çelebi Murat
  • 168
  • 11