git plonk

Updated Jul 13, 2026

Clean up worktrees created by git donkey. The command must be run inside a Git repository. It discovers the main worktree, derives the ../{repo}.worktrees directory used by git donkey, and only operates on linked worktrees listed by Git under that directory.

# Remove completed git-donkey worktrees

git plonk

Default mode removes worktrees whose branch name has a recognized completion marker and whose marker appears in the canonical trunk history used by git plonk. Issue branches named like issue-123-short-title match commits containing (#123). Roadmap branches named like road-1-2-3a-4-short-title match commits containing (road.1.2.3a.4) or (road.1.2.3a.4.). Branches with unrecognized names or no matching trunk history marker are left alone.

Soft mode removes generated directories from all git donkey worktrees without removing worktrees or branches:

git plonk --soft

The generated directory names are target, node_modules, .venv, .tox, .mypy_cache, .pytest_cache, .ruff_cache, htmlcov, dist, build, and coverage.

Hard mode removes completed worktrees and deletes their matching local branches:

git plonk --hard

Hard mode uses the same history-marker check as default mode before deleting a branch. It deletes local branches only; it never deletes remote branches.

Dry-run mode prints the actions git plonk would take and exits without removing generated paths, worktrees, or branches. It can be combined with the default, soft, or hard cleanup mode:

git plonk --dry-run
git plonk --soft --dry-run
git plonk --hard --dry-run