Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gprune

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.

What it does

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.

Install

go install
# or build a local binary
go build -o gprune .

Usage

Run it from inside a git repository:

gprune

Keys

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

Marks

  • [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

License

MIT

About

Prune stale git branches and git worktrees

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages