{
  "id": "git/diverged-branches-fast-forward-rejected",
  "signature": "hint: (e.g., 'git pull ...') before pushing again.",
  "signature_zh": "提示：（例如，'git pull ...'）然后再推送。",
  "regex": "hint: \\(e\\.g\\.\\, 'git pull \\.\\.\\.'\\) before pushing again",
  "domain": "git",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "Local branch has diverged from remote branch, so fast-forward push is rejected; user needs to integrate remote changes first.",
  "root_cause_type": "generic",
  "root_cause_zh": "本地分支与远程分支已分叉，因此快速推送被拒绝；用户需要先整合远程更改。",
  "versions": [
    {
      "version": "git 2.30",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "git 2.35",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "git 2.40",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Run git pull --rebase without checking for conflicts",
      "why_fails": "If conflicts exist, rebase will abort or create messy history; also may lose merge commits.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "Use git push --force to override remote",
      "why_fails": "Dangerous on shared branches; may delete others' commits and cause data loss.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "Ignore the hint and retry push without pulling",
      "why_fails": "Same error will occur because local is still behind remote.",
      "fail_rate": 1.0,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Run 'git pull origin main --ff-only' to fast-forward if possible, then retry push",
      "success_rate": 0.8,
      "how": "Run 'git pull origin main --ff-only' to fast-forward if possible, then retry push",
      "condition": "",
      "sources": []
    },
    {
      "action": "Run 'git pull origin main --rebase' to rebase local commits on top of remote, then push",
      "success_rate": 0.9,
      "how": "Run 'git pull origin main --rebase' to rebase local commits on top of remote, then push",
      "condition": "",
      "sources": []
    },
    {
      "action": "If divergence is intentional, use 'git push --force-with-lease' to safely override remote",
      "success_rate": 0.85,
      "how": "If divergence is intentional, use 'git push --force-with-lease' to safely override remote",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Run 'git pull origin main --ff-only' to fast-forward if possible, then retry push",
    "Run 'git pull origin main --rebase' to rebase local commits on top of remote, then push",
    "If divergence is intentional, use 'git push --force-with-lease' to safely override remote"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://git-scm.com/docs/git-push#_notes",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2023-11-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}