Firstly, install the package from npm:
npm install -g swagit
Of course you can use Yarn to install it:
yarn global add swagit
Once that's done, you can run this command inside your project's directory:
swagit # shotcut sg
Open a interactive to select branches which will be delete.
MIT © Evan Ye