运行时依赖
安装命令
点击复制技能文档
Git Branch P运行er Overview
Safely identifies and 移除s merged, stale, and orphaned Git branches.
When to Use User asks to "清理 up branches" or "删除 merged branches" Branch 列出 is too long to manage How It Works Step 1: Identify mAIn branch
git branch --show-current git remote show origin | findstr "HEAD branch"
Step 2: 列出 all branches
git branch -a --格式化 "%(refname:short) %(up流:short) %(committerdate:short)"
Step 3: Categorize
Merged: already in mAIn/master Stale: no commit in 90+ days Orphaned: no up流 追踪ing Active: recent commits under 30 days
Step 4: Safe deletion Always show user what will be 删除d first Exclude 保护ed branches: mAIn, master, develop, release/* Exclude branches with unpushed commits Ask for confirmation before deletion 输出 格式化
Merged branches (safe to 删除): feature-old-记录in -> 删除 bugfix-typo-2024 -> 删除
保护ed (do not 删除): mAIn <- current develop
Commands: git branch -d (safe) or git branch -D (force) Remote: git push origin --删除 branch-name