Initialize or update BMad-Method (V6) in your project
日本語の概要は準備中です。原文の説明を表示しています。
Safely find and clean up merged or stale Git branches with dry-run mode and custom base/protected branches support
インストールする前に、エージェントに与えられる指示の中身を確認できます。
This command safely identifies and cleans up merged or stale Git branches.
Runs in read-only preview (--dry-run) mode by default, requiring explicit instructions to perform deletions.
# [Safest] Preview branches to be cleaned without executing any deletions
/git-cleanBranches --dry-run
# Clean local branches merged to main and inactive for over 90 days (requires individual confirmation)
/git-cleanBranches --stale 90
# Clean local and remote branches merged to release/v2.1 (auto-confirm)
/git-cleanBranches --base release/v2.1 --remote --yes
# [Dangerous] Force delete an unmerged local branch
/git-cleanBranches --force outdated-feature
--base <branch>: Specify the base branch for cleanup (defaults to repository's main/master).--stale <days>: Clean branches with no commits for specified days (disabled by default).--remote: Also clean remote merged/stale branches.--dry-run: Default behavior. Only list branches to be deleted without executing any operations.--yes: Skip individual confirmations and delete all identified branches directly (suitable for CI/CD).--force: Use -D to force delete local branches (even if unmerged).Configuration and Safety Checks
git fetch --all --prune to ensure branch status is current.--base parameter or auto-detected main/master as comparison baseline.Analysis and Identification (Find)
--remote is added) branches fully merged to --base.--stale <days> is specified, find branches with last commit N days ago.Report and Preview (Report)
--yes parameter, command ends here, waiting for user confirmation to re-execute (without --dry-run).Execute Cleanup (Execute)
--dry-run and after user confirmation (or with --yes).git branch -d <branch>; Remote: git push origin --delete <branch>.--force is specified, local deletion uses git branch -D <branch>.To prevent accidental deletion of important branches (e.g., develop, release/*), add protection rules to the repository's Git config. The command reads them automatically.
# Protect develop branch
git config --add branch.cleanup.protected develop
# Protect all branches starting with release/ (wildcard)
git config --add branch.cleanup.protected 'release/*'
# View all configured protected branches
git config --get-all branch.cleanup.protected
--dry-run: Develop the habit of previewing before executing.--base: When maintaining long-term release branches, use it to clean feature or hotfix branches merged to that release.--force: Don't force delete unless you're 100% certain an unmerged branch is useless.release / develop workflows.date -d./commit command.まだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Initialize or update BMad-Method (V6) in your project
日本語の概要は準備中です。原文の説明を表示しています。
在项目中初始化或更新 BMad-Method (V6)
日本語の概要は準備中です。原文の説明を表示しています。
Add New Feature
日本語の概要は準備中です。原文の説明を表示しています。
用于新增功能开发的命令,支持完整的开发流程和工具集成
日本語の概要は準備中です。原文の説明を表示しています。
安全查找并清理已合并或过期的 Git 分支,支持 dry-run 模式与自定义基准/保护分支
日本語の概要は準備中です。原文の説明を表示しています。
仅用 Git 分析改动并自动生成 conventional commit 信息(可选 emoji);必要时建议拆分提交,默认运行本地 Git 钩子(可 --no-verify 跳过)
日本語の概要は準備中です。原文の説明を表示しています。