Search code examples
azure-devopsazure-repos

Is there a way to avoid deleting a branch in Azure DevOps without obliging pull requests?


In Azure DevOps, configuring a branch policy ensures the branch cannot be deleted. However this also obliges to use pul requests to make changes to that branch.

Currently we are not using pull requests yet, but we still would like to prevent certain branches from getting deleted.

Is there a way to do that other than branch policy?


Solution

  • If you disable the "Force Push" permission, it will block users from deleting the branch.

    The "Force Push" permission...

    Can force an update to a branch, delete a branch, and modify the commit history of a branch. Can delete tags and notes.

    See more on these permissions on Microsoft Learn.

    Thx fenton for answer.