JetBrains Space
 

Set Up Branch and Merge Restrictions

Team
Organization
Enterprise
Last modified: 11 October 2024

While project roles give you the ability to manage write an read permissions in repositories, that alone may not be enough to ensure code quality and efficient collaboration.

Branch protection settings let you safeguard important branches from inadvertent actions and undesirable changes without imposing excessive restrictions on the entire repository.

By creating security rules for a specific branch, you can:

  • Prevent accidental branch deletion.

  • Restrict who can push or force push to the branch.

  • Restrict who can merge changes into the branch.

  • Enable Quality Gates to ensure that only successfully tested, reviewed and approved changes find their way into the branch.

For example, you can prohibit direct pushes to main and require that all changes be submitted via merge requests, pass certain automated checks and have enough approvals from a specified group of members before they can be merged into main.