git-branch-cleanup

Analyze local Git branches by merge status, staleness, and remote tracking.

Updated Dec 23, 2025
One-click install
npx skills add https://github.com/take566/skills --skill git-branch-cleanup-take566
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-branch-cleanup
Source: https://github.com/take566/skills/tree/main/git-branch-cleanup
Command: npx skills add https://github.com/take566/skills --skill git-branch-cleanup-take566

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill helps you manage your local Git branches by identifying and safely removing outdated or merged branches, preventing clutter and potential confusion.

Core Features & Use Cases

  • Branch Analysis: Identifies branches that are merged into your base branch, branches with deleted remotes, and branches that haven't been updated in a while.
  • Safety Guards: Prevents deletion of protected branches (like main or develop) and branches with unpushed commits.
  • Use Case: After completing a feature, you can use this Skill to automatically find and delete the now-merged feature branch, keeping your local repository clean and organized.

Quick Start

Run the git-branch-cleanup script to analyze and suggest branches for deletion.

Frequently Asked Questions about git-branch-cleanup

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?

This Skill automates local Git branch cleanup by analyzing merge status against your base branch, identifying fully merged feature branches, and suggesting them for safe deletion to maintain a clean local repository.

How does Git branch cleanup handle branches with deleted remotes?

Git branch cleanup identifies local branches whose remote tracking branches have been deleted, flagging them as obsolete so you can safely remove them from your local repository without losing active work.

Can I safely delete stale Git branches without losing unpushed commits?

Yes, this Skill includes safety guards that prevent deletion of branches with unpushed commits and protects active base branches like main or develop, ensuring you only remove stale branches that are safe to delete.

What is the best way to find obsolete feature branches in my local Git repository?

The best way to find obsolete feature branches is to analyze branch staleness and remote tracking information, allowing you to identify branches that haven't been updated recently and automatically suggest them for deletion.

Does this Git branch cleanup tool require any special dependencies or modules?

No, this Git branch cleanup tool operates using standard scripts without requiring any special dependencies or external modules, allowing you to analyze repository merge status and branch staleness directly.