4
votes

We used to delete feature branches in pull requests automatically. But then we needed to add branch policy to feature branches and Azure DevOps says "Cannot delete a branch which has policies". Is there a way to delete all merged feature branches afterwards in the remote repo (ie. Azure Repo)? (Other than removing them one by one from UI)

Cannot delete a branch which has policies

1
Are you adding the policy one by one from the UI?Matt
No. Policy is for feature/* branches.Lassi Autio

1 Answers

3
votes

There is already a known user voice for this scenario, you can vote it in the following link:

https://developercommunity.visualstudio.com/idea/905484/allow-to-delete-branch-after-pull-request-in-a-bra.html

Currently, you would either delete the feature branch from UI separately, or disable the branch policy before completing pull request.