prune

Lists the clones whose branch is already merged into the canonical's upstream and which hold nothing uncommitted or unpushed. With `--remove`, it removes them.

gitto prune [--remove] [--stale <days>]

Lists the clones whose branch is already merged into the canonical's upstream and which hold nothing uncommitted or unpushed. With --remove, it removes them.

$ gitto prune
storefront-auth-fix       auth-fix     merged, nothing to lose
storefront-docs-typo      docs-typo    merged, nothing to lose
run 'gitto prune --remove' to delete these

What it leaves alone

A clone with uncommitted changes, a clone with commits no remote has, a clone on a branch that is not merged, and a clone whose submodules host the history of worktrees living outside it. Each of those is what remove refuses, and prune refuses the same things without saying a word about them.

The ones nobody came back to

An agent that stopped halfway leaves a clone that is dirty, unmerged and never coming back. Plain prune leaves it there forever, which is correct and also means a lane nobody is using stays on the list.

--stale <days> adds the clones where nothing has happened for that long:

$ gitto prune --stale 7
storefront-spike-oauth    spike-oauth  untouched for 23d, and it still holds work
run 'gitto prune --remove' to delete these

With --remove, a stale clone that still holds work is bundled into the archive beside the canonical before it goes, exactly as remove --archive does. A stale clone that holds nothing is simply removed.

On this page