Set Merge Restrictions on the main Branch

By default, the main branch is accessible to all project users. To control who can push commits to main, you may want to set restrictions on it and allow merges only after they are approved. This may be especially important if you have users operating in Express mode.

Be sure to repeat this process for each project you created in Create a Simple Extension.
  1. In the left navigator, click Project Administration Project Administration.
  2. Click Branches.
  3. In Repository and Branches, select the Git repository and the main branch.
  4. Select the Requires Review option.
  5. In Default Reviewers, enter and select the users.
    A default reviewer is a project member who is automatically added as a reviewer when a merge request is created on the branch.
  6. From the Approvals drop-down list, select the minimum number of reviewers who must approve the review branch of a merge request, where the selected branch is the target branch
  7. (Optional) To allow a review branch to be merged to the selected branch only if the last build of the linked job in Merge Request is successful, select the Require successful build check box.
    To use this option, link a build job to a merge request.
  8. (Optional) To reset the approval status of reviewers if change is pushed to a branch after they have approved the merge request, select the Reapproval needed when branch is updated check box.
  9. (Optional) To ensure changes pushed to the target branch match the contents of the review branch, select the Changes pushed to target branch must match review content check box.
  10. (Optional) In Merge Request Exempt Users, specify users who can bypass the branch restrictions and merge the review branch of a merge request outside VB Studio or without required approvals.
    This is useful if you want to allow some users to merge the review branch irrespective of review conditions being met.
  11. Click Save.