prune

Prune merged and stale Git branches with previews and confirmations.

23|4|Updated Sep 5, 2013
One-click install
npx skills add https://github.com/drn/dots --skill prune
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prune
Source: https://github.com/drn/dots/tree/main/agents/skills/prune
Command: npx skills add https://github.com/drn/dots --skill prune

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires git, gh, and includes scripts (resource) components.

What problem does it solve?

This Skill helps maintain a clean and organized Git repository by identifying and removing merged, stale, or remote branches that are no longer needed, preventing clutter and potential confusion.

Core Features & Use Cases

  • Identify Merged Branches: Safely lists branches that have been merged into the default branch.
  • Identify Stale Branches: Detects local and remote branches that haven't seen activity for a configurable number of days.
  • Safe Deletion: Provides a preview of branches to be deleted and requires confirmation before removal.
  • Use Case: After completing a feature, you can use this skill to automatically clean up the feature branch and any old remote tracking branches that are no longer in use.

Quick Start

Run the prune skill to preview branches that can be safely deleted.

Frequently Asked Questions about prune

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

FAQPage Schema
How do I clean up merged and stale git branches safely?

To clean up git branches safely, you can use a skill that identifies merged and stale branches, provides a preview of targets, and requires confirmation before deletion. This prevents accidental removal of active work.

Can I delete remote tracking branches that are no longer in use?

Yes, remote branch pruning removes remote tracking branches that are no longer active. The skill manages both local and remote branch cleanup based on merge status and commit age.

Do I need GitHub CLI to prune stale branches?

No, Git is the only required dependency to prune stale branches. GitHub CLI (gh) is optionally used to check for open pull requests before deleting a branch.

What is the best way to identify old local branches for repository maintenance?

The best way to identify old local branches for repository maintenance is to detect branches that have not seen commit activity for a configurable number of days, ensuring only stale branches are targeted.

How does the branch deletion process handle safety previews?

The branch deletion process handles safety previews by generating a list of branches slated for removal and requiring explicit confirmation before executing the actual deletion.

Will this tool delete a branch if it has an open pull request?

No, it will not delete a branch with an open pull request if GitHub CLI is installed. It optionally checks for open PRs to prevent removing branches with active review processes.