Bitbucket Bulk Branch Deleter
Free to download on every platform. Comes pre-installed on BotFone, BotPad and BotFlip — with extra free apps included.
About this app
WHAT IT DOES
Bitbucket Bulk Branch Deleter lets you delete multiple branches in a single operation. Instead of opening each branch's actions menu, clicking delete, and confirming — repeating this for every single branch — this tool provides a unified checklist of all branches on the current page. You can filter branches by type (Default, Stale, Active) to quickly find the ones you want to remove. Select any number of branches using checkboxes and click Delete. The tool then automatically processes each selected branch — opening the delete action and confirming if a confirmation dialog appears. This turns what could be dozens of manual operations into a single batch action, making branch cleanup and repository maintenance significantly faster and more efficient. The tool includes a safety warning for default branches and double-confirmation to prevent accidental deletions.
WHERE IT RUNS
This script runs exclusively on the Bitbucket web application in your browser. It activates on the repository branch list page. It requires the BotGentz extension to inject and execute the script. The tool does not work on the Bitbucket mobile app, the API, or any third-party Git clients — only the web-based Bitbucket interface accessed through a Chromium-based or Firefox browser. It specifically targets pages under *.bitbucket.org, including both cloud and self-hosted Bitbucket instances.
HOW TO USE
After installing the script via BotGentz, navigate to any Bitbucket repository and open the Branches page. The tool automatically detects the branch list and displays a floating panel on the right side. The panel shows all branches on the current page, with checkboxes next to each branch entry. Each branch displays its name, author, last commit date, and a type indicator. Default branches are marked with a star and highlighted in gold. Use the search box to filter by branch name, or use the type filter dropdown to show only default, stale, or active branches. Check the boxes for every branch you want to delete. Click the red "Delete Selected" button and confirm the action. The tool will process each selected branch one by one — opening the delete action and confirming if a confirmation dialog appears. A status message appears when the operation completes, showing how many branches were successfully deleted.
THE ACTUAL MECHANISM — WHY IT WORKS
Bitbucket's web interface is built with React and uses a component-based rendering system for its branch management. The branch list is rendered as rows or list items, each containing branch metadata and action buttons. This tool scans the DOM for branch items using multiple selector patterns that Bitbucket consistently uses across versions. For each branch, it extracts the name, author, last commit date, and type/status from the visible text content and data attributes. Each branch is assigned a unique identifier from data attributes or checkbox values. When deleting, the tool locates the delete button within each branch item or accesses it through the action menu. The tool then handles any confirmation dialog that appears. This approach works without making direct Git commands or API calls, which would require authentication credentials and knowledge of Bitbucket's internal API structure. By using the existing UI, the tool works within Bitbucket's own permission and validation system, and continues to function even if the underlying API changes. Default branches are flagged to prevent accidental deletion.
THE PANEL
The floating panel is fully draggable — click and drag the header to reposition it anywhere on the page. The panel's position is saved per site in localStorage, so it reappears exactly where you left it when you return to the branches page. Double-click the header to snap the panel to the nearest edge (left or right). A collapse button minimizes the panel to a small tab showing a branch emoji badge, keeping it out of the way while still accessible. The branch list inside the panel is scrollable and resizes vertically based on the number of branches. Pressing Escape while the panel is focused closes it completely; reopening is done via a small button injected near the page toolbar. All panel interactions are non-blocking — Bitbucket's main UI remains fully responsive while the panel is open, and the panel updates automatically when you navigate between repositories or pages.
PLEASE NOTE
This script requires the BotGentz extension (free) to run user scripts on Bitbucket. Bitbucket frequently updates its web interface and modal structures; if the tool stops working, check for an updated version within BotGentz's script repository. This tool does not store, transmit, or log any branch data, repository information, or deletion history — all operations occur locally in your browser with no external network requests except those made by Bitbucket itself. Branch deletions are applied through Bitbucket's own UI event system, so all changes respect your repository permissions and branch protection rules. The tool does not bypass Bitbucket's security or permission system; it simply automates the clicks you would otherwise perform manually. For repositories with a large number of branches, the tool may take several minutes to complete the operation, as each branch is processed sequentially with delays to avoid overwhelming the UI. A progress indicator shows which branch is currently being processed. Always double-check your selections before deleting, as deleted branches can be difficult or impossible to recover. The tool only affects branches visible on the current page; to delete all branches, use Bitbucket's built-in pagination controls or adjust your view to show all relevant branches. The tool displays a warning if you attempt to delete default branches and allows you to proceed or cancel as needed.