trailofbits/skills✦ 精选0°

git-cleanup

仓库创建 2026年1月15日最近提交 6 天前SkillHot 收录 20 天前
▸ 精选理由

适合长期开发者清理本地垃圾分支,避免误删关键工作

▸ 风险提示

会执行删除操作,可能误删未推送的本地更改

这个 Skill 做什么

分析并安全清理本地分支与工作树,区分已合并、过时与活跃工作

帮你把本地 Git 分支和 worktree 自动分类并安全清理,能识别已合并、squash 合并、被替代和仍在开发中的分支。适合本地分支堆积很多、远程已删但本地还留着,或想回收磁盘空间时使用。特别之处是不会贸然删除活跃工作,会给出可删、疑似相关和保留建议并附带删除理由,降低误删风险。

▸ 展开 SKILL.md 英文原文

Safely analyzes and cleans up local git branches and worktrees by categorizing them as merged, squash-merged, superseded, or active work.

开发编程git清理分支管理通用
6.3k
Stars
542
Forks
40
仓库内 Skill
+270
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/trailofbits/skills/main/plugins/git-cleanup/skills/git-cleanup/SKILL.md
或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/trailofbits/skills/main/plugins/git-cleanup/skills/git-cleanup/SKILL.md"
SKILL.MD 节选查看完整文件 ↗
# Git Cleanup

Safely clean up accumulated git worktrees and local branches by categorizing them into: safely deletable (merged), potentially related (similar themes), and active work (keep).

## When to Use

- When the user has accumulated many local branches and worktrees
- When branches have been merged but not cleaned up locally
- When remote branches have been deleted but local tracking branches remain

## When NOT to Use

- Do not use for remote branch management (this is local cleanup only)
- Do not use for repository maintenance tasks like gc or prune
- Not designed for headless or non-interactive automation (requires user confirmations at two gates)

## Core Principle: SAFETY FIRST
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有