Managing Branches of Git Repositories
From the Project Settings: Branches page, you can manage default reviewers and set restrictions.
You can assign multiple project members as default reviewers of a branch. When a merge request is created for a particular branch, the default reviewers are automatically added to the Reviewers list. You can set rename, delete, push and merge restrictions on a branch and can also lock a branch if you do not want anyone to push commits or merge another branch to it.
Assigning Default Reviewers to a Repository Branch
A default reviewer is a project member who is automatically added as a reviewer when a merge request is created on a specified target branch. You can assign default reviewers to any Git repository branch of your project. The user interface makes it easy for you to assign multiple members of your project to a branch or assign multiple branches to a single project member.
- In the navigation bar, click Project Settings.
- Click Branches.
- Click the By Branch toggle button.
- In Repository and Branches, select the Git repository and branch.
- In Default Reviewers, select the members whom you want to assign the default reviewer role of the branch.
When you’re finished, use the project navigation bar to switch to another page.
Setting Branch Restrictions
By default, any project member can rename or delete a repository branch, and push and merge into it. As a project Owner, you can protect a repository branch and restrict rename, delete, push and merge to project owners, default reviewers and the creator of a merge request. You can also lock a branch if you do not want anyone (including project owners and reviewers) to push commits or merge another branch to it.
When you’re finished, use the project navigation bar to switch to another page.
Assigning Repository Branches to a Project Member
You can assign multiple repository branches to a project member. When a merge request is created for the specified branch, the default reviewers are automatically added to the Reviewers list.
- In the navigation bar, click Project Settings.
- Click Branches.
- Click the By User toggle button.
- In User, select the project member.
- In Repository, select the Git repository.
- In Branches, select the branches that you want to assign to the member.
When you’re finished, use the project navigation bar to switch to another page.