Branches Cleanup banner
zengtianli zengtianli

Branches Cleanup

Git community

Description

扫 ~/Dev 全部 git repo,找出已合并到 main 的分支(本地+远端),列表批准后一键删。 ## 用法 ``` /branches-cleanup # 扫 ~/Dev 全部 repo /branches-cleanup --repo <path> # 单 repo ``` 无参默认扫 `~/Dev` 全部。 ## 背景 用户默认在 main 上干活,**不开 feature branch**(要开必须先讲理由)。merge 完的分支是思维负担,必须清。本 skill 把「merge 完顺手清」固化成动作。 ## 执行 ### 1. 收集 repo - 无 `--repo` → `find ~/Dev -name .git -type d -maxdepth 4 -prune` 列所有 repo - 有 `--repo <path>` → 只看这一个 ### 2. 每个 repo 扫已合并分支 进 repo 目录,跑: ```bash git fetch --prune origin

Installation

Installs to ~/.claude/skills/zengtianli-cc-configs-branches-cleanup/SKILL.md

Terminal
mkdir -p ~/.claude/skills/zengtianli-cc-configs-branches-cleanup && curl -fsSL https://raw.githubusercontent.com/zengtianli/cc-configs/HEAD/commands/branches-cleanup.md -o ~/.claude/skills/zengtianli-cc-configs-branches-cleanup/SKILL.md

Restart Claude Code, or start a new session, for it to be picked up.

Full documentation available on GitHub

View Source Repository