{
  "id": "git/commit-not-possible-because-index-is-locked",
  "signature": "fatal: Unable to create '.git/index.lock': File exists.",
  "signature_zh": "致命错误：无法创建 '.git/index.lock'：文件已存在。",
  "regex": "fatal: Unable to create '.*\\.git/index\\.lock': File exists\\.",
  "domain": "git",
  "category": "resource_error",
  "subcategory": null,
  "root_cause": "A previous git command crashed or is still running, leaving the index.lock file, which prevents any new write operations.",
  "root_cause_type": "generic",
  "root_cause_zh": "之前的 git 命令崩溃或仍在运行，留下了 index.lock 文件，阻止任何新的写入操作。",
  "versions": [
    {
      "version": "git 2.30.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "git 2.39.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "git 2.42.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Destroys all commit history and branches; overkill for a simple lock file issue.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The lock file persists, so the same error occurs again.",
      "fail_rate": 1.0,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Does not remove the lock file; may lose uncommitted changes without fixing the issue.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Remove the lock file manually: rm -f .git/index.lock",
      "success_rate": 0.95,
      "how": "Remove the lock file manually: rm -f .git/index.lock",
      "condition": "",
      "sources": []
    },
    {
      "action": "Check for hanging git processes: ps aux | grep git, then kill them before removing the lock file.",
      "success_rate": 0.85,
      "how": "Check for hanging git processes: ps aux | grep git, then kill them before removing the lock file.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If using Windows, use del .git\\index.lock from the repository root.",
      "success_rate": 0.9,
      "how": "If using Windows, use del .git\\index.lock from the repository root.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Remove the lock file manually: rm -f .git/index.lock",
    "Check for hanging git processes: ps aux | grep git, then kill them before removing the lock file.",
    "If using Windows, use del .git\\index.lock from the repository root."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://git-scm.com/docs/git-lockfile",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.95,
  "resolvable": "true",
  "first_seen": "2023-03-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}