Search code examples
gitazure-devopsbranching-and-merging

Bypass policies when pushing but Prevent commits to Main Branch


If a user has Bypass policies when pushing enabled, how can I also configure it so that the same user is unable to commit directly to Main branch?

enter image description here

enter image description here


Solution

  • You may enable this permission on the repo level:

    enter image description here

    and disable on the branch level:

    enter image description here