{
  "id": "git/push-delete-refspec",
  "signature": "remote: error: cannot push to a protected ref 'refs/heads/main'",
  "signature_zh": "远程：错误：无法推送到受保护的引用 'refs/heads/main'",
  "regex": "cannot push to a protected ref",
  "domain": "git",
  "category": "auth_error",
  "subcategory": null,
  "root_cause": "Attempt to push to a branch that is protected by repository rules (e.g., GitHub branch protection), requiring pull requests or admin approval.",
  "root_cause_type": "generic",
  "root_cause_zh": "尝试推送到受仓库规则保护的（例如 GitHub 分支保护）分支，需要拉取请求或管理员批准。",
  "versions": [
    {
      "version": "git 2.37.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "git 2.41.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "git 2.44.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Forcing push with 'git push --force' will be rejected by the remote server.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Deleting the protected branch locally and pushing again will fail due to remote protection.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Create a new branch, push it, and open a pull request for review: 'git checkout -b feature-branch && git push origin feature-branch'.",
      "success_rate": 0.9,
      "how": "Create a new branch, push it, and open a pull request for review: 'git checkout -b feature-branch && git push origin feature-branch'.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Request admin to temporarily disable branch protection, then push.",
      "success_rate": 0.6,
      "how": "Request admin to temporarily disable branch protection, then push.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Create a new branch, push it, and open a pull request for review: 'git checkout -b feature-branch && git push origin feature-branch'.",
    "Request admin to temporarily disable branch protection, then push."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.85,
  "resolvable": "partial",
  "first_seen": "2023-06-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}