{
  "id": "git/merge-tree-corrupted",
  "signature": "fatal: corrupt tree: <hash>: duplicate entries for '<filename>'",
  "signature_zh": "致命：损坏的树对象：<哈希>：'<文件名>' 的重复条目",
  "regex": "fatal: corrupt tree: [a-f0-9]+: duplicate entries for '[^']+'",
  "domain": "git",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "A tree object in the Git object database contains duplicate entries for the same file path, indicating repository corruption due to hardware failure, manual object manipulation, or buggy tools.",
  "root_cause_type": "generic",
  "root_cause_zh": "Git 对象数据库中的树对象包含同一文件路径的重复条目，表明由于硬件故障、手动操作对象或有漏洞的工具导致仓库损坏。",
  "versions": [
    {
      "version": "git 2.37.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "git 2.38.2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "git 2.39.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Deleting all objects is extreme and may lose local branches, stashes, or uncommitted work; a reclone should only be done if remote is healthy, but it ignores local-only objects.",
      "fail_rate": 0.4,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "git gc may fail or skip corrupt objects without fixing the duplicate entry, and can make the corruption harder to recover by packing objects.",
      "fail_rate": 0.65,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Run 'git fsck --full' to identify all corrupt objects, then use 'git replace --edit <hash>' to manually remove the duplicate entry from the tree object",
      "success_rate": 0.7,
      "how": "Run 'git fsck --full' to identify all corrupt objects, then use 'git replace --edit <hash>' to manually remove the duplicate entry from the tree object",
      "condition": "",
      "sources": []
    },
    {
      "action": "If a remote backup exists, reclone the repository and cherry-pick local commits: 'git clone <remote> new-repo && cd new-repo && git remote add old ../old-repo && git fetch old && git cherry-pick <local-commits>'",
      "success_rate": 0.8,
      "how": "If a remote backup exists, reclone the repository and cherry-pick local commits: 'git clone <remote> new-repo && cd new-repo && git remote add old ../old-repo && git fetch old && git cherry-pick <local-commits>'",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Run 'git fsck --full' to identify all corrupt objects, then use 'git replace --edit <hash>' to manually remove the duplicate entry from the tree object",
    "If a remote backup exists, reclone the repository and cherry-pick local commits: 'git clone <remote> new-repo && cd new-repo && git remote add old ../old-repo && git fetch old && git cherry-pick <local-commits>'"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://git-scm.com/docs/git-fsck",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.83,
  "fix_success_rate": 0.75,
  "resolvable": "true",
  "first_seen": "2023-09-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}