dsh-branch-cleaner

Redundant branch cleaner: finds branches whose work already landed in the mainline — merged, squash-merged, patch-equivalent after rebase or cherry-pick, upstream-gone, or PR-merged — and deletes them when asked. It only reports by default, never switches branches or rebases, and backs every deleted local branch up under refs/backup/branch-cleaner/ (deleting remote branches has no backup).

Overview

Redundant branch cleaner: finds branches whose work already landed in the mainline — merged, squash-merged, patch-equivalent after rebase or cherry-pick, upstream-gone, or PR-merged — and deletes them when asked. It only reports by default, never switches branches or rebases, and backs every deleted local branch up under refs/backup/branch-cleaner/ (deleting remote branches has no backup).

Installation

Install from npm

dsh plugin --profile web add dsh-branch-cleaner

Resolves a published tarball rather than cloning the repository, and installs without any extra setup. Swap `web` for your profile name if you run another one.

Install from GitHub

dsh plugin --profile web add github:ramwin/dsh-branch-cleaner

Installing from GitHub runs the project's build script, which pnpm blocks until you allowlist it — run the command once and pnpm prints the exact key to add under `allowBuilds` in ~/.dsh/profiles/web/pnpm-workspace.yaml.

Version compatibility

Compatibility is unconfirmed. Check the project documentation for supported versions.