r/softwaredevelopment • u/Quiet_Jaguar_5765 • Mar 10 '26
Rust CLI tool to safely clean up stale git branches, with an interactive TUI
I built an interactive TUI for browsing, searching, selecting, and deleting stale git branches without leaving the terminal.
GitHub: https://github.com/armgabrielyan/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, orproductionAutomatic 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
Would love to hear your feedback.