{
  "id": "git/conflict-in-binary-file",
  "signature": "warning: Cannot merge binary files: image.png (HEAD vs. origin/main)",
  "signature_zh": "警告：无法合并二进制文件：image.png（HEAD vs. origin/main）",
  "regex": "warning: Cannot merge binary files: .* \\(HEAD vs\\..*\\)",
  "domain": "git",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "Git cannot automatically merge binary files (e.g., images, PDFs) because they have no text-based diff, leading to a conflict that requires manual resolution.",
  "root_cause_type": "generic",
  "root_cause_zh": "Git 无法自动合并二进制文件（例如图像、PDF），因为它们没有基于文本的差异，导致冲突需要手动解决。",
  "versions": [
    {
      "version": "git 2.26.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "git 2.33.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "git 2.38.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Binary files contain non-text data; editing them as text corrupts the file.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Most merge tools cannot display a meaningful diff for binaries; the tool may fail or show nothing useful.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Git still marks the file as conflicted; the merge cannot complete until the conflict is resolved.",
      "fail_rate": 1.0,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Choose one version explicitly: git checkout --ours image.png (keep HEAD version) or git checkout --theirs image.png (keep incoming version), then git add image.png",
      "success_rate": 0.85,
      "how": "Choose one version explicitly: git checkout --ours image.png (keep HEAD version) or git checkout --theirs image.png (keep incoming version), then git add image.png",
      "condition": "",
      "sources": []
    },
    {
      "action": "If both versions are needed, manually copy the correct version from a backup or regenerate the file, then git add image.png",
      "success_rate": 0.75,
      "how": "If both versions are needed, manually copy the correct version from a backup or regenerate the file, then git add image.png",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use a dedicated binary merge tool like 'git lfs' or 'git-annex' for large binary files to avoid conflicts in the future.",
      "success_rate": 0.7,
      "how": "Use a dedicated binary merge tool like 'git lfs' or 'git-annex' for large binary files to avoid conflicts in the future.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Choose one version explicitly: git checkout --ours image.png (keep HEAD version) or git checkout --theirs image.png (keep incoming version), then git add image.png",
    "If both versions are needed, manually copy the correct version from a backup or regenerate the file, then git add image.png",
    "Use a dedicated binary merge tool like 'git lfs' or 'git-annex' for large binary files to avoid conflicts in the future."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://git-scm.com/docs/git-merge#_handling_binary_files",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.84,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2023-04-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}