consolidate-git

Consolidate owned stale Git branches and worktrees into the current branch.

5|2|Updated Mar 20, 2026
One-click install
npx skills add https://github.com/dbc-oduffy/coordinator-claude --skill consolidate-git
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: consolidate-git
Source: https://github.com/dbc-oduffy/coordinator-claude/tree/main/plugins/coordinator/skills/consolidate-git
Command: npx skills add https://github.com/dbc-oduffy/coordinator-claude --skill consolidate-git

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It eliminates Git branch and worktree sprawl by consolidating your in-flight work onto a single current branch, removing stale branches/worktrees owned by you while leaving other owners’ work untouched.

Core Features & Use Cases

  • Inventories local/remote branches by ownership: categorizes branches into current (target), main (merge target), your stale branches (candidate for deletion/absorption), and other people’s branches (reported only).
  • Inventories all worktrees and cleans stale state: lists worktrees, applies the same ownership/reachability logic, unlocks stale locks when safe, and removes stale worktrees (including locked ones whose branch tips are absorbed).
  • Evidence-gated absorb-or-skip for unique commits: detects whether stale branches have unique commits, inspects each unique commit with git show/--stat, then cherry-picks or merges as appropriate without default merging to main.
  • Guardrails against accidental history loss: avoids touching other owners, uses safe delete (git branch -d) semantics, and verifies absorbed shared-infra changes after conflict resolution.

Quick Start

Use the coordinator:consolidate-git skill to consolidate your owned stale branches and worktrees into the current branch without merging to main by default.

Frequently Asked Questions about consolidate-git

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I clean up stale git branches and worktrees without losing uncommitted work?

To clean up stale git branches and worktrees safely, you can absorb unique commits from stale branches into your current branch via cherry-pick or merge, then delete the stale branch and worktree leftovers while preserving uncommitted changes.

How do I consolidate multiple local git branches into a single current branch?

Consolidating multiple local git branches involves inventorying branches by your user.email, inspecting unique commits with git show, cherry-picking or merging those commits into the current branch, and safely deleting your stale branches without merging to main.

Does git branch cleanup affect branches owned by other developers?

Safe git branch cleanup does not affect branches owned by other developers. The process inventories branches by git user.email and only absorbs and deletes stale branches you own, leaving other owners' branches untouched.

What is the best way to remove locked git worktrees safely?

Removing locked git worktrees safely requires inventorying all worktrees by ownership, verifying the branch tip commits are absorbed into the current branch, unlocking stale locks when safe, and then removing the stale worktree.

How does cherry-pick compare to merge for absorbing unique commits from stale branches?

Cherry-pick applies individual unique commits from stale branches onto the current branch, while merge brings the entire branch history. Evidence-gated inspection uses cherry-pick or merge as appropriate to absorb unique commits without defaulting to a merge to main.

When should I not use automated git branch consolidation?

You should not use automated git branch consolidation when stale branches contain unverified shared-infra changes, as conflict resolution requires verifying absorbed changes, or when other owners' branches need to be preserved in the repository.