git-workflow

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Git Workflow

Git工作流

Advanced git workflow automation for branch management and PR lifecycle.
面向分支管理与PR生命周期的高级Git工作流自动化。

When to use

适用场景

When managing complex git operations — multi-branch workflows, release branching, conflict resolution, or PR coordination.
当你需要管理复杂Git操作时——多分支工作流、发布分支、冲突解决或PR协作。

Steps

步骤

  1. Analyze repo — call
    mcp__claude-flow__github_repo_analyze
    for repository health metrics
  2. Check diff risk — call
    mcp__claude-flow__analyze_diff-risk
    before merging
  3. Manage PRs — call
    mcp__claude-flow__github_pr_manage
    for PR lifecycle operations
  4. View metrics — call
    mcp__claude-flow__github_metrics
    for merge frequency, review times, etc.
  1. 分析仓库 —— 调用
    mcp__claude-flow__github_repo_analyze
    获取仓库健康指标
  2. 检查差异风险 —— 合并前调用
    mcp__claude-flow__analyze_diff-risk
  3. 管理PR —— 调用
    mcp__claude-flow__github_pr_manage
    执行PR生命周期操作
  4. 查看指标 —— 调用
    mcp__claude-flow__github_metrics
    查看合并频率、审核时长等数据

Common workflows

常见工作流

Feature branch

功能分支

bash
git checkout -b feat/my-feature
bash
git checkout -b feat/my-feature

... make changes ...

... 进行修改 ...

analyze diff before PR

创建PR前分析差异

create PR with risk assessment

结合风险评估创建PR

undefined
undefined

Release branch

发布分支

bash
git checkout -b release/v1.2.0
bash
git checkout -b release/v1.2.0

cherry-pick fixes

挑选修复提交

analyze all diffs for risk

分析所有差异的风险

merge when risk score is acceptable

风险评分达标后合并

undefined
undefined

CLI alternative

CLI替代方案

bash
npx @claude-flow/cli@latest hooks pre-task --description "git workflow"
bash
npx @claude-flow/cli@latest hooks pre-task --description "git workflow"