Bharat
Bharat

Reputation: 1205

Can I merge a pull request into multiple branches especially during release branches

Usually this is not the scenario, however I have such requirements during the release phase.

Let's say we have release every month and just before the release we create a release branch on which the testing is in progress. At the same time we continue to work on master branch.

Now there is a defect comes from UAT(testing) and that needs to be fixed. So we do that fix in master branch and we create a pull request which then gets merged with master. At this time, we want the same change needs to be part of release branch too.

Is there any way I can merge this pull request in master as well as in release branch. One of the solution could be using Cherry picking


Thanks in advance

Bharat

Upvotes: 3

Views: 3551

Answers (2)

Christoph-Tobias Schenke
Christoph-Tobias Schenke

Reputation: 3290

Im not sure if i understand you correctly... You make bugfixes for your release-branch in branches which were created from master. after merging them back to master you want to merge the fix to your release-branch?

why dont you make your fixes for release on top of the release branch and afterwards you merge all fixes made on release branch back to master?

Upvotes: 1

kowsky
kowsky

Reputation: 14459

Cherry picking is indeed the best solution here, since you only want to bring the bugfix to your release branch.

If there was other work done on master before the bugfix and you issue the same pull request to release as you did to master, all the unrelated work done on master will also be in release. Since you do not want that, you should cherry-pick just the bugfix commit(s) to your release branch (depending on your workflow you might have to create a bugfix branch from release, cherry-pick there and issue a pull request to release).

Upvotes: 1

Related Questions