{
  "id": "git/rebase-detached-head",
  "signature": "fatal: You are not currently on a branch. Use 'git rebase --onto' or 'git checkout' first.",
  "signature_zh": "致命：您当前不在一个分支上。请先使用 'git rebase --onto' 或 'git checkout'。",
  "regex": "You are not currently on a branch",
  "domain": "git",
  "category": "user_error",
  "subcategory": null,
  "root_cause": "User attempted to run git rebase while in detached HEAD state, which is disallowed because there is no branch to update.",
  "root_cause_type": "generic",
  "root_cause_zh": "用户在分离 HEAD 状态下尝试运行 git rebase，因为没有任何分支可以更新，所以不允许这样做。",
  "versions": [
    {
      "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"
    },
    {
      "version": "git 2.45.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Running 'git rebase <branch>' without checking out a branch first will still fail.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Using 'git rebase --continue' after a failed rebase in detached state will not resolve the issue.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Create a branch from the current detached HEAD: 'git checkout -b temp-branch', then run rebase.",
      "success_rate": 0.95,
      "how": "Create a branch from the current detached HEAD: 'git checkout -b temp-branch', then run rebase.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use 'git rebase --onto <target> <upstream>' to rebase without needing a branch.",
      "success_rate": 0.7,
      "how": "Use 'git rebase --onto <target> <upstream>' to rebase without needing a branch.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Create a branch from the current detached HEAD: 'git checkout -b temp-branch', then run rebase.",
    "Use 'git rebase --onto <target> <upstream>' to rebase without needing a branch."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://git-scm.com/docs/git-rebase",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.84,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2023-09-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}