How can I restrict access to a branch?
Please Note: Branch restrictions will not prevent users from pulling or viewing protected branches, the feature will only prevent pushes. Account owner and admins can not be restricted from pushing to branches.
Restricting user access to a branch means that only selected users will be allowed to push to it.
- Navigate to the Settings section tab in a repository.
- Select to Permissions.
- Choose Restrict access to a branch at the bottom of the page.
- Now you can select which users you want to give push access. By default, the account owner, admins and users with Read & Write access can push to all branches.
- To restrict a user to one branch, uncheck the checkbox to the left of their name and choose Restrict Access.