This task can be performed using Gat
Git Automation Tool
Best product for this task
Gat
dev-tools
A few months ago I needed to clear every feature branch that were in my local repo. After delete manually more than 10 branches, it was so annoying that I didn't want to repeat it. So I thought, I've never build a full Rust app before but I'll use it to help me with git. So created gat, a terminal tool that with one command, it executes whatever is needed so I don't need to do boring git operations and can focus on cool rebase interactive operations. I hope it can help you as much as it helps me.

What to expect from an ideal product
- Lets you delete dozens of feature branches with a single command instead of removing them one by one manually
- Automatically finds and lists all your local feature branches so you can pick which ones to remove without typing each branch name
- Saves hours of repetitive typing by handling all the git branch deletion commands behind the scenes
- Works from any directory in your git repo and cleans up your branch list in seconds rather than minutes
- Prevents the tedious process of running "git branch -d" over and over for each old feature branch you want to get rid of
