A small terminal UI for pruning merged and stale git branches (and their worktrees).
⚠️ This whole thing was vibecoded. It was built end-to-end by prompting an LLM, with light human steering. It works for me, but it has not been carefully audited line by line — read the code before pointing it at anything you care about, and keep in mind that it deletes branches and worktrees.
gprune lists branches that are candidates for deletion and lets you pick which ones to remove. A branch shows up if it is either:
- merged into the current branch (
git branch --merged), or - upstream gone — its remote tracking branch was deleted, which is how a squash-merged PR usually looks locally.
For each selected branch it deletes the local branch, removes the linked worktree first if there is one, and deletes the remote branch when the branch still tracks a remote.
go install
# or build a local binary
go build -o gprune .Run it from inside a git repository:
gprune| Key | Action |
|---|---|
j / k, ↑↓ |
move cursor |
space |
select / unselect branch |
a |
select / unselect all |
f |
git fetch --prune, then reload the list |
enter |
confirm selected branches |
? |
help |
q |
quit |
[worktree]— branch is checked out in another worktree (removed before delete)(upstream gone)— remote tracking branch was deleted (e.g. PR merged)→ origin— branch tracks a remote; deletion also removes the remote branch