Git Worktree Cleanup and Branch Hygiene at Scale When managing automation-heavy repos with accumulated stale worktrees and branches: (1) identify worktrees attached to merged branches via , (2) remove them with before deleting branches (worktrees block deletion), (3) categorize remaining branches by lifecycle (worktree-agent remnants, orphan pre-restructure branches with no common ancestor, superseded feature branches, protected branches), (4) delete merged branches remotely first, then locally, (5) for unmerged branches with value, dry-run merges and resolve conflicts by keeping the current…