Addition to @1615903's answer, you can protect a branch in Azure DevOps like below:
Using Azure DevOps
In Azure DevOps, protecting a branch with security permissions and policies which allow you can do the following:
- Add or remove users and groups to a specific branch.
- Declare a minimum number of reviewers for pull requests.
- Automatically include code reviewers
- Automatically check linked work items is required or optional
- Check for comment resolution
- Enforce a merge strategy(No-fast-forward or squash)
- Build validation
and more detailed information on the docs page.
To protect the branch:
- Select Repos > Branches in the project's main page to open the
Branches.
- Locate your branch on the page in which all branches are listed.
- Select the ... button. Then select Branch policies or Branch security
from the context menu.
- Once you have done, select Save changes to apply your new policy configuration.