{
  "id": "git/checkout-conflict-with-untracked-files",
  "signature": "error: The following untracked working tree files would be overwritten by checkout: file.txt",
  "signature_zh": "错误：以下未跟踪的工作树文件将被检出覆盖：file.txt",
  "regex": "error: The following untracked working tree files would be overwritten by checkout:",
  "domain": "git",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "Git checkout would overwrite untracked files in the working directory that are present in the target branch but not tracked in the current branch.",
  "root_cause_type": "generic",
  "root_cause_zh": "Git检出会覆盖工作目录中未跟踪的文件，这些文件在目标分支中存在，但在当前分支中未被跟踪。",
  "versions": [
    {
      "version": "2.38.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "2.39.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "2.40.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Adding the file to .gitignore and retrying checkout.",
      "why_fails": "The file is already untracked, so .gitignore won't help; it only prevents future tracking. The checkout still sees the file as a conflict.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "Using 'git checkout --force' to override the error.",
      "why_fails": "Force checkout will overwrite the untracked file, potentially losing data. It works but is dangerous.",
      "fail_rate": 0.3,
      "condition": "",
      "sources": []
    },
    {
      "action": "Running 'git clean -fd' to delete all untracked files blindly.",
      "why_fails": "This deletes all untracked files, not just the conflicting one, which may remove important files.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Move the conflicting untracked files to a safe location: 'mv file.txt file.txt.backup'. Then checkout the branch. After checkout, you can compare and restore if needed.",
      "success_rate": 0.95,
      "how": "Move the conflicting untracked files to a safe location: 'mv file.txt file.txt.backup'. Then checkout the branch. After checkout, you can compare and restore if needed.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Alternatively, stash the untracked files: 'git stash --include-untracked'. Then checkout the branch. Later apply the stash: 'git stash pop'.",
      "success_rate": 0.9,
      "how": "Alternatively, stash the untracked files: 'git stash --include-untracked'. Then checkout the branch. Later apply the stash: 'git stash pop'.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "将冲突的未跟踪文件移动到安全位置：'mv file.txt file.txt.backup'。然后检出分支。检出后，如果需要可以比较并恢复。",
    "或者，将未跟踪文件暂存：'git stash --include-untracked'。然后检出分支。之后应用暂存：'git stash pop'。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://git-scm.com/docs/git-checkout#Documentation/git-checkout.txt---force",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.9,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2023-09-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}