🧹
DevOpsTypeScript

Git Clean Branches

by UfoMiao

Git Clean Branches is a DevOps skill for Claude Code, published by UfoMiao in zcf.

6.1K stars424 forkson UfoMiao/zcfAdded 2026/08/15Repository updated 2026/08/12
agentaiai-agentbmad-methodccrclaudeclaude-4claude-aiclaude-codecligptgpt-5llmllm-codenodejsopenaiprompttypescriptworkflowzcf
Install in seconds
Install Git Clean Branches
Copy Git Clean Branches into your Claude Code skills folder. Run the command in your terminal, or review the source on GitHub before installing.
terminal
npx degit https://github.com/UfoMiao/zcf/tree/main/templates/skills/zh-CN/git-clean-branches ~/.claude/skills/git-clean-branches

Requires Node.js. Downloads this skill only — not the rest of the repository — into your Claude Code skills folder.

Without Node.js

git clone https://github.com/UfoMiao/zcf.git

Clones the whole repository, then copy the skill’s own directory into your skills folder yourself.

In this catalog

Source file
templates/skills/zh-CN/git-clean-branches/SKILL.md in UfoMiao/zcf
Installs to
~/.claude/skills/git-clean-branches
Collection
One of 20 skills cataloged from this repository
Category
DevOps798 skills

What Git Clean Branches does

Git Clean Branches identifies and safely deletes merged or stale Git branches, defaulting to a dry-run preview. Use it to clean local and remote branches after merges or inactivity.

Git Clean Branches is cataloged under DevOps on DirSkills. Git Clean Branches comes from a repository tagged agent, ai, ai-agent, bmad-method and ccr.

Documentation

README

Claude Command: Clean Branches

该命令安全地识别并清理已合并长期未更新 (stale) 的 Git 分支。 默认以只读预览 (--dry-run) 模式运行,需明确指令才会执行删除操作。


Usage

# [最安全] 预览将要清理的分支,不执行任何删除
/git-cleanBranches --dry-run

# 清理已合并到 main 且超过 90 天未动的本地分支 (需逐一确认)
/git-cleanBranches --stale 90

# 清理已合并到 release/v2.1 的本地与远程分支 (自动确认)
/git-cleanBranches --base release/v2.1 --remote --yes

# [危险] 强制删除一个未合并的本地分支
/git-cleanBranches --force outdated-feature

Options

  • --base <branch>:指定清理的基准分支(默认为仓库的 main/master)。
  • --stale <days>:清理超过指定天数未提交的分支(默认不启用)。
  • --remote:同时清理远程已合并/过期的分支。
  • --dry-run默认行为。仅列出将要删除的分支,不执行任何操作。
  • --yes:跳过逐一确认的步骤,直接删除所有已识别的分支(适合 CI/CD)。
  • --force:使用 -D 强制删除本地分支(即使未合并)。

What This Command Does

This is the opening of the README. Read the full README on GitHub.

Commands Git Clean Branches provides

Slash commands named in this skill’s SKILL.md, listed in the order they first appear.

  • /commit

Frequently asked about Git Clean Branches

  • What else does UfoMiao publish alongside Git Clean Branches?

    Git Clean Branches is one of 20 skills that DirSkills catalogs from UfoMiao/zcf, the repository it ships in. Its siblings there include BMad Init, BMad Init and Feature Development. Each one is a separate skill with its own page in this directory, installs the same way Git Clean Branches does, and is maintained by UfoMiao in that same repository. The rest of the collection is listed on the UfoMiao/zcf page.

  • How does Git Clean Branches compare to other DevOps skills?

    Git Clean Branches ranks #132 by stars among the 798 DevOps skills in this catalog. The most-starred ones next to it are Backend Patterns, API Connector Builder and Migration. DirSkills ranks by the star count of the repository each skill ships in, so that order reflects how popular those repositories are rather than any review of Git Clean Branches against them. Open each page to compare what they document and how they install.

More from UfoMiao/zcf

Git Clean Branches is one of 20 skills cataloged on DirSkills from UfoMiao/zcf.

See all 20 skills
🚀
2w ago

BMad Init

BMad Init initializes or updates BMad-Method (V6) in a project, running the official installer, fixing known output folder bugs, and updating .gitignore. Use it for fresh installs, quick updates, or legacy V4 migration.
AI Engineering
6.1K424
🚀
2w ago

BMad Init

BMad Init initializes or updates BMad-Method V6 in a project, checking for legacy V4 installations and running the appropriate non-interactive installer. It also fixes known installer output-folder issues and keeps .gitignore aligned with V6.
AI Engineering
6.1K424
🛠️
2w ago

Feature Development

Feature Development turns a new feature request into a plan, discussion, and execution workflow. It uses planning and design agents to produce implementation documents and guide development.
AI Engineering
6.1K424
🗂️
2w ago

Feature Planning

Feature Planning analyzes incoming requests to determine whether they are requirement planning, discussion iteration, or execution implementation. It then generates planning documents and coordinates agents to add new features, ensuring frontend tasks have UI designs before development.
AI Engineering
6.1K424
🧹
2w ago

Git Clean Branches

Git Clean Branches safely identifies and cleans up merged or stale Git branches with dry-run mode and protected branch configuration. It helps keep repositories clean without risking accidental deletion of important branches.
DevOps
6.1K424
✍️
2w ago

Git Commit

Git Commit analyzes changes with Git only and auto-generates conventional commit messages with optional emoji, suggesting split commits when needed. Use it when you want atomic, conventional commits without any package manager or build tools.
Automation
6.1K424