Large Scale Branch Hygiene

Systematic approach to cleaning stale branches across multiple repos while preserving active work

vamseeachanta Updated

File contents

Large-Scale Branch Hygiene Workflow

When managing many repos with accumulated stale branches: (1) inventory all repos and categorize branches (worktree artifacts, orphaned histories, merged-upstream), (2) identify patterns (e.g., archive/* branches from restructurings that can't merge), (3) use dry-runs to verify before mass deletion, (4) handle protected branches separately and verify API errors aren't transient, (5) stash active work, merge valuable unmerged branches, clean merged branches, then restore stash. Key insight: pull latest before merge attempts—upstream may have already merged branches you think are local.

vamseeachanta/workspace-hub/tree/main/.agents/skills/workspace-hub/learned/large-scale-branch-hygiene commit 7f56bf47e5

Frequently asked questions

npx skillmds@latest add vamseeachanta/large-scale-branch-hygiene