Thanks to everyone for voting and commenting on this suggestion. Your input in the comments helps us understand how this affects you and what you're hoping to accomplish with Bitbucket Data Center.
We spend a significant amount of time determining our product investments in Bitbucket Data Center. Unfortunately, we are not planning to address this suggestion in the next 12 months. In the last year, we have resolved many of the highly voted suggestions like Reviewer groups, Pull request templates, capability to enable/disable source branch deletion on merging pull requests and our upcoming roadmap includes a number of other top voted suggestions, including repository archiving. Please check out our public roadmap for more details on the coming soon and future items.
Meantime, for bulk deletion of merged branches you can periodically execute the following bash script. It deletes all remote branches that have been fully merged into the "current" checked-out branch (in our case this is "develop"):
# list merged branches
BRANCHES=`git branch -r --merged | grep -v "*" | grep -v master | grep -v develop | grep -v release/ | grep -v hotfix/ | sed 's/origin\///'`
printf "Removing branches: \n$BRANCHES"
# delete all remote branches merged into the current branch (i.e. develop), excluding release/master/develop branches
git branch -r --merged | grep -v "*" | grep -v master | grep -v develop | grep -v release/ | grep -v hotfix/ | sed 's/origin\///' | xargs -n 1 git push --delete origin
It's also worth mentioning that since Bitbucket 7.15 admins can choose if delete source branch should be the default option on pull request merge. We believe defaulting deletion of source branches should help to prevent growth of merged and stale branches.
I understand that this may be disappointing, but it’s important for us to be open, honest, and transparent with our customers. Product feedback is collected from many different sources and is evaluated when planning the product roadmap. You can learn more about our process here.
Product Manager - Bitbucket Data Center & Server