A zero-dependency CLI that scans local & remote Git branches, cross-references them with pull-request state, and safely prunes what is genuinely dead. These pages are the reference; the README has the full narrative, and the playground runs the real decision engine in your browser.
npm install -g @maliqkara/gitcleanup
cd ~/your/repo && git-cleanup scan # what's dead?
git-cleanup prune # deletes nothing without asking
git-cleanup sweep # every configured repo in one pass
| Page | What it covers |
|---|---|
| Install | npm, Homebrew, npx, from source; requirements |
| Usage | Every command: scan, prune, prs, sweep, report-issue, doctor, backup, completions, hooks |
| Configuration | The full schema: thresholds, rules, protected globs, remote/backup/sweep sections, layered config files |
| Forge support | GitHub, GitLab, Gitea/Codeberg, Bitbucket Cloud & Server: tokens, API bases, self-hosted host claims |
| Automation | JSON output shapes, exit codes, sweep in cron, CI gates, the GitHub Action |
| FAQ & troubleshooting | Safety model, squash-merge detection, doctor, common errors |
git branch --merged only catches branches whose commits are
literal ancestors of your base. Squash merges, rebase merges, and
cherry-picks rewrite the commits — so those dead branches look unmerged
forever and accumulate. git-cleanup additionally fingerprints each
branch's final tree against the base's history, which catches
them, and is deliberately conservative: protected and checked-out
branches are never touched, unmerged work is never deleted without an
explicit force rule, and every deletion that loses unique commits writes
a recoverable git bundle first.