I’ve recently been tidying up some of my personal project code repositories in Azure DevOps, treating them like professional environments where possible to get myself into some better habits. Part of this is ensuring that old branches are properly cleaned up and removed where no longer required.
But I kept receiving an error when trying to delete a branch that stated “Failed to delete ‘branch’. Force push permission is required to delete branches” which is less than ideal, and somewhat confusing considering I’m logged in as an Organization owner with full Admin rights on the related project.

The Fix
Luckily, the fix in this case proved to be quite straightforward. I ensured that on each individual branch, I had the Force push permission set to Allow. This permission was either for a group containing my user or directly on my user.
Individual Branch
You can do this by following the steps below for each individual branch –
- Navigate to the Branches page under Repos.
- Hover over the relevant branch and select the ellipses icon to open the menu.
- Select Branch Security.
- Select a group containing your user or your user account.
- Set ‘Force push (rewrite history, delete branches and tags)‘ to Allow.
- Try to delete the branch again and it should work.
Entire Project
If you’d like to implement the fix for all repositories in the project then you can follow the steps below instead –
- Navigate to Project Settings.
- Select the Repositories page found under Repos.
- Navigate to the Security tab.
- Select a group containing your user or your user account.
- Set ‘Force push (rewrite history, delete branches and tags)‘ to Allow.
- Try to delete the branch again and it should work.
Further information on Git branch security can be found on Microsoft Learn at Microsoft Learn – Azure DevOps – Set branch permissions








Leave a reply to 1518sdf759 Cancel reply