git-branch-cleaner

Delete merged Git branches from local and remote repositories.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/tukaelu/agent-skills --skill git-branch-cleaner
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-branch-cleaner
Source: https://github.com/tukaelu/agent-skills/tree/main/skills/git-branch-cleaner
Command: npx skills add https://github.com/tukaelu/agent-skills --skill git-branch-cleaner

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill automates the removal of merged branches from your local and remote Git repositories, preventing clutter and improving repository hygiene.

Core Features & Use Cases

  • Safe Deletion: Automatically identifies and deletes branches that have been merged into a specified base branch.
  • Scope Control: Allows users to specify whether to clean local branches, remote branches, or both.
  • Protection: Prevents deletion of critical branches like main, master, develop, and the currently checked-out branch.
  • Use Case: After merging a feature branch, use this skill to automatically clean it up from both your local and remote repositories, keeping your Git history tidy.

Quick Start

Use the git-branch-cleaner skill to remove all merged branches from your local repository, using 'main' as the base branch.

Frequently Asked Questions about git-branch-cleaner

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

FAQPage Schema
How do I automatically delete merged git branches from local and remote repositories?

To delete merged git branches, use a cleanup tool that fetches remote changes, identifies merged branches, and executes safe deletion commands like git branch -d and git push origin --delete. You can specify the scope as local, remote, or both.

What is the safest way to clean up merged branches without losing active work?

The safest way to clean up merged branches is by using an automated tool that protects critical branches like main, master, develop, and the currently checked-out branch from deletion. It also prompts for user confirmation before executing any removal commands.

Can I clean up remote merged branches while protecting the main and develop branches?

Yes, you can clean up remote merged branches while protecting main and develop. The cleanup process automatically safeguards critical branches like main, master, and develop, ensuring only safely merged branches are targeted for remote deletion.

How do I remove local git branches that have already been merged into the main branch?

To remove local git branches merged into main, specify 'main' as the base branch and set the scope to local. The tool identifies branches successfully merged into that base and runs git branch -d to execute the safe local deletion.

Does git branch cleanup require manual confirmation before deleting remote branches?

Yes, git branch cleanup requires manual confirmation. The process identifies merged branches across your specified scope and prompts for user confirmation before executing any remote or local deletion commands to ensure repository safety.