Reapply a Merge Request's Commits to a New Branch

VB Studio provides you with the ability to reapply changes (commits) from a closed or deleted merge request to a newly-created merge request in another branch. This process is called retargeting. Retargeting works on branches that were already merged or even on ones that were deleted. This is a great way to backport your changes into another branch or another target.

Retargeting doesn't change the target branch for an existing MR, it creates a new MR with a new target branch. If you have pending or open MRs, you'll never even see the Reapply Changes button. MRs that couldn't be merged need to be closed before you can use the button to do the following things to retarget and reapply your changes:
  1. Create a new branch.
  2. Cherry-pick commits.
  3. Create a new MR.
  4. Generate the description with a link to the original MR.
Here's how to do it:
  1. Click Reapply Changes Reapply Changes to display the Reapply Changes dialog.
  2. Select a target branch from the Target Branch dropdown. The target branch is the branch where the review changes are going to be reapplied (and added to the top of) after the review.
  3. The Review Branch field is automatically filled out for you as soon as you select the target branch.
    The Create branch icon indicates that this branch will be created for you.
  4. The Reapply Changes information box summarizes the actions that will take place.
    Below the information box, the Commits section shows the commits that were cherry-picked.
  5. Click Reapply Changes to create a new merge request.
    You'll see a link in the MR notification to the original merge request from which this MR was generated.
  6. Click Merge when done.
Sometimes you might not be able to perform this operation, like for a protected branch or if the changes you are trying to reapply were already merged into the branch. Files with conflicts can also cause problems and must be manually merged before proceeding.