ce-clean-gone-branches

Delete local Git branches whose remote tracking branches were removed.

10|Updated Dec 13, 2016
One-click install
npx skills add https://github.com/vitallium/dotfiles --skill ce-clean-gone-branches-vitallium
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ce-clean-gone-branches
Source: https://github.com/vitallium/dotfiles/tree/main/dot_agents/skills/ce-clean-gone-branches
Command: npx skills add https://github.com/vitallium/dotfiles --skill ce-clean-gone-branches-vitallium

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Remove local branches whose remote tracking branch has been deleted, including any associated worktrees, to keep a lean and accurate local repository.

Core Features & Use Cases

  • Discover stale local branches that no longer exist on the remote and present them for review.
  • Safely delete branches while removing any related worktrees to prevent orphaned references.
  • Suitable for routine repository hygiene after remote pruning or when branches are abandoned.

Quick Start

Run the discovery script to identify gone branches and confirm deletion when prompted.

Frequently Asked Questions about ce-clean-gone-branches

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

FAQPage Schema
How do I clean local Git branches after the remote tracking branch is deleted?

To clean local Git branches after the remote is deleted, this Skill fetches remote state, identifies gone branches, and removes them along with associated worktrees after user confirmation.

What is the best way to delete stale worktrees when pruning gone Git branches?

Deleting stale worktrees during gone Git branch cleanup is handled by identifying branches whose remote tracking branch is gone and removing both the branch and its worktree safely.

How do I identify which local Git branches no longer exist on the remote?

To identify local Git branches no longer existing on the remote, the Skill fetches current remote state and compares it against local tracking branches to present stale branches for review.

Can I safely remove abandoned local branches and their worktrees without manual deletion?

Yes, you can safely remove abandoned local branches and worktrees without manual deletion; the Skill discovers stale branches and deletes them after user confirmation to prevent orphaned references.

Does this Git branch cleanup process require confirmation before deleting local branches?

Yes, Git branch cleanup requires confirmation; the Skill implements a three-step workflow that fetches remote state, identifies gone branches, and prompts for user confirmation before deleting them.

Why do I have orphaned worktree references after deleting remote Git branches?

Orphaned worktree references occur because deleting a remote Git branch does not automatically remove local branches or worktrees; this Skill prunes both to keep your local repository accurate.