{
  "id": "git/ambiguous-argument-revision",
  "signature": "fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.",
  "signature_zh": "致命错误：参数 'HEAD' 有歧义：未知的修订版本或路径不在工作树中。",
  "regex": "^fatal: ambiguous argument '.+': unknown revision or path not in the working tree\\.$",
  "domain": "git",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "The repository is empty (no commits) or HEAD is invalid, causing Git to fail to resolve 'HEAD' as a revision.",
  "root_cause_type": "generic",
  "root_cause_zh": "仓库为空（没有提交）或 HEAD 无效，导致 Git 无法将 'HEAD' 解析为修订版本。",
  "versions": [
    {
      "version": "git 2.20",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "git 2.30",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "git 2.45",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The error is about HEAD not being resolvable, not about a missing branch; checkout will fail with a different error.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "These commands may also fail with the same error if HEAD is invalid; they don't fix the underlying issue.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "If the repository is empty, make an initial commit: git add . && git commit -m 'Initial commit'. This creates a valid HEAD.",
      "success_rate": 0.95,
      "how": "If the repository is empty, make an initial commit: git add . && git commit -m 'Initial commit'. This creates a valid HEAD.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If HEAD is corrupted, reset it to a known state: git symbolic-ref HEAD refs/heads/main (if main branch exists) or reinitialize the repository: git init (backup data first).",
      "success_rate": 0.75,
      "how": "If HEAD is corrupted, reset it to a known state: git symbolic-ref HEAD refs/heads/main (if main branch exists) or reinitialize the repository: git init (backup data first).",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "If the repository is empty, make an initial commit: git add . && git commit -m 'Initial commit'. This creates a valid HEAD.",
    "If HEAD is corrupted, reset it to a known state: git symbolic-ref HEAD refs/heads/main (if main branch exists) or reinitialize the repository: git init (backup data first)."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://git-scm.com/docs/git-rev-parse#_specifying_revisions",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2023-04-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}