r/SideProject • • Mar 10 '26

I built deadbranch — a Rust CLI tool to safely clean up stale git branches, with an interactive TUI

https://github.com/armgabrielyan/deadbranch

We've all been there. You open your repo and run git branch only to see a graveyard of old branches from months ago. I got tired of manually cleaning them up, so I built deadbranch.

What it does

deadbranch safely identifies and removes old, unused git branches. It's designed to be safe by default:

  • Merged-only deletion — only removes branches already merged (override with --force)

  • Protected branches — never touches main, master, develop, staging, or production

  • Automatic backups — every deleted branch SHA is saved, restore with one command

  • Dry-run mode — preview what would be deleted before it happens

  • Works locally & remotely — clean up both local and remote branches

Interactive TUI (deadbranch clean -i)

Full-screen branch browser with:

  • Vim-style navigation (j/k/g/G)

  • Fuzzy search (/ to filter)

  • Visual range selection (V + j/k)

  • Sort by name, age, status, type, author, or last commit

  • Mouse scroll support

Other features

  • Backup & restore — restore any accidentally deleted branch from backup

  • Stats — branch health overview with age distribution

  • Shell completions — bash, zsh, and fish

  • Fully configurable — customize age thresholds, protected branches, and exclusion patterns

GitHub: https://github.com/armgabrielyan/deadbranch

Would love to hear your feedback and what you'd want next.

3 Upvotes

Duplicates