同步多个git worktree的开发结果。查看状态、合并分支、清理worktree。
Synchronizes multiple git worktrees by checking status, merging feature branches, and cleaning up merged worktrees.
/plugin marketplace add pure-maple/cc-mmo-plugin/plugin install mmo@cc-mmo-plugin$ARGUMENTS 格式:
status - 查看所有worktree状态merge - 合并所有feature分支到maincleanup - 清理已合并的worktree# 列出所有worktree
git worktree list
# 查看各分支状态
echo "=== Worktree状态 ==="
for wt in $(git worktree list --porcelain | grep worktree | cut -d' ' -f2); do
echo "--- $wt ---"
(cd "$wt" && git status --short && git log -1 --oneline)
done
| Worktree | 分支 | 未提交变更 | 最新提交 |
|---|---|---|---|
| main | main | 0 | abc123 |
| ../project-auth | feature/auth | 2 | def456 |
| ../project-ui | feature/ui | 0 | ghi789 |
使用 integrator agent 进行合并:
调用 integrator agent 合并所有feature分支
# 删除已合并的worktree
git worktree remove ../project-feature-auth
git worktree remove ../project-feature-ui
# 删除对应分支
git branch -d feature/auth
git branch -d feature/ui
# 清理残留引用
git worktree prune
删除前确认:
# 1. 查看状态
/mmo:sync-worktrees status
# 2. 合并分支
/mmo:sync-worktrees merge
# 3. 验证合并结果
/mmo:verify full
# 4. 清理worktree
/mmo:sync-worktrees cleanup
如遇合并冲突,integrator agent会: