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:
- Create a new branch.
- Cherry-pick commits.
- Create a new MR.
- Generate the description with a link to the original MR.
Here's how to do it:
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.