Reapply a Merge Request's Commits to a New Branch
VB Studio enables you to reapply commits from a merged or closed merge request to a new merge request and review branch.
Use Reapply Changes to backport your changes from merge requests that were already merged or closed into a new merge request with another target branch. It cherry-picks the original merge request's commits to create a new merge request with the original code changes inside a new review branch.
Note:
- Linked issues from the original merge request are retained when a merge request is reapplied.
- Comments from the original merge request are not retained.
Reapply Changes requires that the original merge request is closed or merged. If you have open merge requests, you won’t see the Reapply Changes button; open merge requests must be closed before you can use the button.
There are instances where you cannot use Reapply Changes, such as when a branch is protected 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.
When you click Reapply Changes, you can select Reapply All Commits or Reapply Merged Changes.
- Reapply All Commits – Reapplies all of the commits listed on the merge request Commits tab. In other words, it reapplies all of the commits from the review branch.
- Reapply Merged Changes – Reapplies the actual result of the merge, rather than the individual commits from the review branch. In other words, it reapplies the commits from the target branch that were created when the merge request was merged.
Reapply All Commits
Here's how to reapply all commits from a closed or merged merge request:
- Click
Reapply Changes, then select Reapply All Commits.
- On the Reapply All Commits dialog, select a target branch from the Target Branch dropdown. The target branch is where the commits from your new merge request are applied after reviewing and merging your new review branch.
- The Review Branch field is automatically filled out for you when you select the target branch, but you can edit the name of the branch.
The
icon indicates that this branch will be created for you.
- Review the information in the Reapply All Commits box for a summary of the actions that will take place, as well as information about the commits you are reapplying.
- Click Reapply All Commits to create a new review branch with a merge request to the target branch you selected.
In the merge request notification that appears, you’ll find a link to the original merge request from which this new one was generated.
Reapply Merged Changes
Here's how to reapply merged changes from a closed or merged merge request:
- Click
Reapply Changes, then select Reapply Merged Changes.
- On the Reapply Merged Changes dialog, select a target branch from the Target Branch dropdown. The target branch is where the commits from your new merge request are applied after reviewing and merging your new review branch.
- The Review Branch field is automatically filled out for you when you select the target branch, but you can edit the name of the branch.
The
icon indicates that this branch will be created for you.
- Review the information in the Reapply Merged Changes box for a summary of the actions that will take place, as well as information about the merged changes you are reapplying.
- Click Reapply Merged Changes to create a new review branch with a merge request to the target branch you selected.
In the merge request notification that appears, you’ll find a link to the original merge request from which this new one was generated.
Note:
Reapply Merged Changes is disabled for:- Open or closed merge requests.
- Merge requests merged from the command line.
- Merge requests merged before VB Studio version 24.04.0.