git-prune-merged

Remove local Git branches merged into origin/main with optional dry-run preview.

2|Updated Nov 6, 2015
One-click install
npx skills add https://github.com/ahoym/dotfiles --skill git-prune-merged
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-prune-merged
Source: https://github.com/ahoym/dotfiles/tree/main/.claude/commands/git-prune-merged
Command: npx skills add https://github.com/ahoym/dotfiles --skill git-prune-merged

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps maintain a clean local Git repository by identifying and removing branches that have already been merged into the main branch, streamlining your workflow.

Core Features & Use Cases

  • Automated Branch Pruning: Detects and removes local branches that are fully merged into origin/main.
  • Dual Merge Strategy Support: Handles both regular merges and squash merges (where the remote branch is deleted).
  • Dry Run Mode: Allows you to preview which branches would be deleted without making any changes.
  • Use Case: After completing a feature and merging it via a pull request, you can use this Skill to automatically clean up the feature branch from your local repository.

Quick Start

Run /git-prune-merged to list and prune merged branches after confirmation.

Frequently Asked Questions about git-prune-merged

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

FAQPage Schema
How do I clean up local Git branches that have been merged?

To clean up local Git branches that have been merged, you can use an automated tool to detect branches fully integrated into the main branch and remove them after interactive confirmation. This streamlines repository maintenance.

Can I delete local branches from squash merges if the remote is gone?

Yes, you can delete local branches from squash merges if the remote is gone. The pruning process identifies branches whose remote counterparts are deleted and removes them, supporting both regular and squash merge strategies.

How do I preview which merged Git branches will be deleted before removing them?

To preview which merged Git branches will be deleted, use a dry-run mode. This option lists branches slated for deletion without making any changes, allowing you to verify selections before executing the cleanup.

What is the best way to automate Git branch management after a pull request?

The best way to automate Git branch management after a pull request is running a cleanup command that detects fully integrated feature branches. It identifies merged local branches and prunes them upon your confirmation.

Do I need to manually check if a branch is merged into origin/main before pruning?

No, you do not need to manually check if a branch is merged into origin/main before pruning. The cleanup process automatically detects local branches fully merged into the remote main branch and lists them for removal.