Skip to content

Latest commit

 

History

45 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gh-wtrm

A gh CLI extension to safely list and remove stale git worktrees, using PR merge status (gh-poi style) to avoid deleting worktrees whose work has not actually been merged.

Install

gh extension install tnagatomi/gh-wtrm

Usage

gh wtrm

Operates on the repository containing the current working directory. It opens an interactive TUI listing that repo's worktrees with PR-derived badges ([pr-merged], [pr-open], [pr-closed], [uncommitted], [locked], [no-dir], [primary], [current]).

Keys: space select, s select all safe-to-remove, / filter, d delete (with confirmation), y copy branch name, r reload, ? help, q/esc quit.

A worktree is "safe to remove" only when its branch has a merged PR whose commit set contains the branch's local HEAD commit (plus no uncommitted work, not locked, and not the primary or current worktree). A directory that is already gone is treated as a prune target. The primary and current worktrees are not selectable; the current worktree is marked [current].

Flags

--state merged   # default: only merged PRs count as deletable
--state closed   # opt-in: also accept PRs closed without merging (and merged)

About

gh extension to list and safely remove stale git worktrees

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages