Lock a branch using the Branches view Lock the branch by selecting the … icon next to the branch name and then selecting Lock from the menu. A lock icon will appear next to the branch name. Unlock a locked branch by selecting Unlock from the same menu.
How do I restrict a git Branch?
- Navigate to the main page of the project.
- In the upper right corner, click the settings wheel and select Protected branches.
- From the Branch dropdown menu, select the branch you want to protect and click Protect.
- Once done, the protected branch will appear in the “Already protected” list.
How do I set permissions on a Branch?
Go to Project settings > Branch permissions. Click Add permission. In the Branches field, specify which branches the permission applies to, either by Branch name, Branch pattern, or Branching model. In the Restrictions field, select the type of actions to prevent and add exemptions for any of the selected restrictions.