branches-clean

Delete non-main local and remote Git branches sequentially with safety checks.

12|5|Updated Feb 5, 2026
One-click install
npx skills add https://github.com/davidahmann/gait --skill branches-clean
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: branches-clean
Source: https://github.com/davidahmann/gait/tree/main/.agents/skills/branches-clean
Command: npx skills add https://github.com/davidahmann/gait --skill branches-clean

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automates the deletion of outdated or unnecessary branches in a Git repository, helping to maintain a clean and organized project history.

Core Features & Use Cases

  • Safe Branch Deletion: Deletes local and remote branches one-by-one, with safety checks.
  • Main Branch Protection: Ensures the main branch is never deleted.
  • Use Case: After merging a feature branch, use this Skill to automatically clean up both the local and remote versions of that branch, preventing clutter.

Quick Start

Use the branches-clean skill to delete all non-main local and remote branches.

Frequently Asked Questions about branches-clean

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

FAQPage Schema
How do I safely delete non-main Git branches in my local and remote repositories?

To safely delete non-main Git branches, this Skill processes local and configured-remote branches sequentially with built-in safety checks, ensuring the main branch is protected while providing detailed reports on deleted and remaining branches.

What is the best way to automate Git branch cleanup after merging feature branches?

Automating Git branch cleanup after merging feature branches is handled by sequentially deleting outdated local and remote branches, enforcing fail-closed policies to maintain project hygiene and prevent repository clutter.

Does Git branch deletion automation protect the main branch from being removed?

Git branch deletion automation strictly protects the main branch from being removed by enforcing fail-closed safety mechanisms, ensuring only non-main local and configured-remote branches are deleted sequentially.

Can I clean up remote Git branches automatically without risking my main branch?

You can clean up configured-remote Git branches automatically because the process applies fail-closed safety policies, sequentially deleting non-main branches while explicitly protecting the main branch from any deletion actions.

How do I get a report of deleted and remaining Git branches after repository cleanup?

To get a report of deleted and remaining Git branches after repository cleanup, the Skill provides detailed outputs upon completion, listing all non-main branches processed sequentially and identifying any branches that remain.