git-cleanup
Skill0 starsChanged 10 months agoMITView on GitHub
Cleans up merged Git branches safely. Use when cleaning up old branches, deleting merged branches, or maintaining repository hygiene.
- Commits and pushes
11 other projects use a version of this.
Adopted by
Most recently taken up by
- UlyssesLeoLee/MAGOStheir own version, first seen Nov 4, 2026
- yk-tanigawa/repo-templatetheir own version, first seen Nov 1, 2026
- bryanus1/agent-skillstheir own version, first seen Nov 1, 2026
- tanuuuuuuu/dotfilestheir own version, first seen Oct 20, 2026
- davidanthonyn/claude-skillstheir own version, first seen Oct 20, 2026
- InanisV/my-claude-skillstheir own version, first seen Aug 22, 2026
Used with
Projects with it also use skill-creator.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
SentrySkillskill-creator
Create new agent skills following the Agent Skills specification. Use when asked to "create a skill", "add a new skill", "write a skill", "make a skill", "build a skill", or scaffold a new skill with SKILL.md. Guides through requirements, writing, registration, and verification.
Also in 4 projects that use this
Other versions11 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 11
- alibaba/page-agent★ 29ksame name
- viknesh20-20/claude-code-tool-kit★ 7same name
- InanisV/my-claude-skills★ 1same name
- UlyssesLeoLee/MAGOS★ 1same name
- bryanus1/agent-skills★ 0same name
- davidanthonyn/claude-skills★ 0same name
- linnene/Code-Standards-Skills★ 0same name
- tanuuuuuuu/dotfiles★ 0same name
- TheWatcher01/skills★ 0same name
- uts58/my-random-skills★ 0same name
1 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository4 other files it gives its agents.
- git-branchSkill
- git-commitSkill
- git-prSkill
- git-repo-guideSkill
The file
Files
Git Cleanup
清理已合并的分支
Context
- 当前分支: !
git branch --show-current - 本地分支: !
git branch - 已合并到 develop: !
git branch --merged develop 2>/dev/null - 已合并到 main: !
git branch --merged main 2>/dev/null - 远程分支: !
git branch -r | head -30
Protected Branches
以下分支永远不删除:
mainmasterdevelopdevrelease/*(当前活跃的)
Workflow
Step 1: 扫描分支
分析可清理的分支:
🧹 分支清理扫描
📋 可安全删除的分支(已合并):
本地分支:
✓ feature/old-feature (合并于 2025-01-20)
✓ bugfix/login-fix (合并于 2025-01-18)
远程分支:
✓ origin/feature/old-feature
✓ origin/bugfix/login-fix
🔒 保护分支(不删除):
• main
• develop
⚠️ 未合并分支(跳过):
• feature/work-in-progressStep 2: 确认删除
🗑️ 将删除以下分支:
本地: 2 个
• feature/old-feature
• bugfix/login-fix
远程: 2 个
• origin/feature/old-feature
• origin/bugfix/login-fix
请选择操作:
• 输入 "all" → 删除所有
• 输入 "local" → 仅删除本地
• 输入 "remote" → 仅删除远程
• 输入分支名 → 删除指定分支
• 输入 "cancel" → 取消Step 3: 执行删除
# 删除本地分支
git branch -d feature/old-feature
git branch -d bugfix/login-fix
# 删除远程分支
git push origin --delete feature/old-feature
git push origin --delete bugfix/login-fix
# 清理远程引用
git fetch --pruneStep 4: 输出结果
✅ 分支清理完成!
🗑️ 已删除:
├─ 本地: 2 个分支
│ • feature/old-feature
│ • bugfix/login-fix
└─ 远程: 2 个分支
• origin/feature/old-feature
• origin/bugfix/login-fix
🔒 保留:
├─ main
├─ develop
└─ feature/work-in-progress (未合并)
💡 提示: 使用 git fetch --prune 定期清理远程引用Safety Measures
- 只删除已合并分支:使用
git branch --merged - 保护核心分支:main/develop 永不删除
- 确认后执行:不自动删除,等待用户确认
- 使用 -d 而非 -D:-d 只删除已合并分支,更安全
Error Handling
| 情况 | 处理 |
| 无可清理分支 | ✨ 没有需要清理的分支,仓库很整洁! |
| 删除当前分支 | ❌ 无法删除当前分支,请先切换到其他分支 |
| 远程删除失败 | 继续删除其他,最后汇报失败的分支 |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

