Quick start
1. Run it
Section titled “1. Run it”You don’t have to install anything to try gitbroom — run it straight from
npx inside any repository:
npx gitbroomRequires Node.js ≥ 18 and git on your PATH. To keep it around, install
globally instead:
npm i -g gitbroom# or: pnpm add -g gitbroom2. Preview with a dry run
Section titled “2. Preview with a dry run”Before deleting anything, see exactly what gitbroom would remove. A dry run
changes nothing — it’s the recommended first run:
gitbroom --dry-run Default branch: main · current: feature-y
Merged into default branch: ✓ feature-x (merged) ✓ hotfix-123 (merged)
Upstream gone: ⚠ old-spike (upstream gone) — force delete
Dry run: 3 branch(es) would be deleted.Candidates are grouped by why they’re stale. A force delete label means
the branch isn’t merged and would need git branch -D — see
How it works for what that means.
3. Confirm and delete
Section titled “3. Confirm and delete”Happy with the list? Run gitbroom with no flags. It prints the same grouped
list and then asks before removing anything:
gitbroom Delete 3 branch(es)? [y/N]Type y (or yes) to proceed; anything else aborts without deleting. On
success you’ll see each branch confirmed:
deleted feature-x deleted hotfix-123 deleted old-spike
Swept 3 branch(es).Going further
Section titled “Going further”- Sweep only one kind of branch:
gitbroom --mergedorgitbroom --gone. - Skip the prompt in scripts:
gitbroom -y. - Point at a non-standard default branch:
gitbroom --main develop.
See the full CLI reference for every flag and exit code.