{
  "id": "git/error-branch-not-fully-merged",
  "signature": "error: The branch 'feature-x' is not fully merged. If you are sure you want to delete it, run 'git branch -D feature-x'.",
  "signature_zh": "错误：分支 'feature-x' 未完全合并。如果您确定要删除它，请运行 'git branch -D feature-x'。",
  "regex": "error: The branch '[^']+' is not fully merged\\. If you are sure you want to delete it, run 'git branch -D [^']+'\\.",
  "domain": "git",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "Attempting to delete a branch with git branch -d that has commits not reachable from the current HEAD or its upstream, indicating potential loss of work.",
  "root_cause_type": "generic",
  "root_cause_zh": "尝试使用 git branch -d 删除一个分支，该分支包含从当前 HEAD 或其上游无法到达的提交，表明可能会丢失工作。",
  "versions": [
    {
      "version": "git 1.7.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "git 2.30.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 merge --squash on the branch before deleting does not actually merge the commits; it only creates a squash commit that doesn't preserve history, so the branch still appears unmerged.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Using git branch -d after a git rebase that rewrites history may still fail because the original commits are no longer directly referenced, even if they are functionally merged.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "git branch -D feature-x  # Force delete the branch if you are certain its work is no longer needed",
      "success_rate": 1.0,
      "how": "git branch -D feature-x  # Force delete the branch if you are certain its work is no longer needed",
      "condition": "",
      "sources": []
    },
    {
      "action": "git checkout feature-x && git log --oneline --not --remotes=origin  # Review unmerged commits, then merge or cherry-pick them to main before safe deletion with git branch -d",
      "success_rate": 0.9,
      "how": "git checkout feature-x && git log --oneline --not --remotes=origin  # Review unmerged commits, then merge or cherry-pick them to main before safe deletion with git branch -d",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "git branch -D feature-x  # Force delete the branch if you are certain its work is no longer needed",
    "git checkout feature-x && git log --oneline --not --remotes=origin  # Review unmerged commits, then merge or cherry-pick them to main before safe deletion with git branch -d"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://git-scm.com/docs/git-branch#Documentation/git-branch.txt--d",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.95,
  "resolvable": "true",
  "first_seen": "2023-04-12",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}