Bypass branch policies for user/group in Azure DevOps

Bypass branch policies for user/group in Azure DevOps

My thought is that "When you see something as issue you never find a solution or probable solution. When you see that as a learning experience you will always get something at the end".

To make history of main branch as clean as possible and protect the branch , Admin has created following policy settings for merge.

Branch Policy.png

Now the project I am working I have to merge one branch to another branch without loosing the history of source branch. This is not allowed due to branch policy as you can see following things.

Complete Pull request screen.png

Solution:

You can set following things at repository level to set permission for User group or user.

Settings.png

Double click on "not set" . It will toggle different option Allow, Deny and Not Set. Choose "Allow".

After that you can see following things. ( Refresh of pull request page required). You can see "Must override policies". On Selection of this you can have reason box . Provide that and complete the PR (pull request).

After Applying Settings.png