{
  "id": "git/merge-branch-refused-due-to-uncommitted-changes",
  "signature": "error: Your local changes to the following files would be overwritten by merge: file.txt Please commit your changes or stash them before you merge.",
  "signature_zh": "错误：您对以下文件的本地更改将被合并覆盖：file.txt 请在合并之前提交更改或将其暂存。",
  "regex": "error: Your local changes to the following files would be overwritten by merge: .* Please commit your changes or stash them before you merge\\.",
  "domain": "git",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "Uncommitted changes in the working directory conflict with incoming merge changes, and Git refuses to proceed to prevent data loss.",
  "root_cause_type": "generic",
  "root_cause_zh": "工作目录中的未提交更改与传入的合并更改冲突，Git 拒绝继续以防止数据丢失。",
  "versions": [
    {
      "version": "git 2.28.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "git 2.34.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "git 2.41.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Permanently discards all local changes, which may be unintended.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Wipes all uncommitted changes, including those in other files.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Does not bypass the error; the merge still refuses to proceed.",
      "fail_rate": 1.0,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Stash your changes: git stash push -m 'temp stash', then merge, then apply stash: git stash pop",
      "success_rate": 0.9,
      "how": "Stash your changes: git stash push -m 'temp stash', then merge, then apply stash: git stash pop",
      "condition": "",
      "sources": []
    },
    {
      "action": "Commit your changes: git add file.txt && git commit -m 'save local changes', then merge.",
      "success_rate": 0.85,
      "how": "Commit your changes: git add file.txt && git commit -m 'save local changes', then merge.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If the changes are not needed, discard them: git checkout -- file.txt, then merge.",
      "success_rate": 0.8,
      "how": "If the changes are not needed, discard them: git checkout -- file.txt, then merge.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Stash your changes: git stash push -m 'temp stash', then merge, then apply stash: git stash pop",
    "Commit your changes: git add file.txt && git commit -m 'save local changes', then merge.",
    "If the changes are not needed, discard them: git checkout -- file.txt, then merge."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://git-scm.com/docs/git-merge",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2023-06-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}