# 错误：对象文件 .git/objects/ab/cdef1234 为空

- **ID:** `git/object-corruption-empty-file`
- **领域:** git
- **类别:** data_error
- **错误码:** `E001`
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

由于磁盘损坏、不当关机或手动篡改，仓库中的 git 对象文件为空。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| git 2.38 | active | — | — |
| git 2.43 | active | — | — |
| git 2.45 | active | — | — |

## 解决方案

1. ```
   Restore the empty object from a backup or remote: git fetch origin refs/heads/main:refs/remotes/origin/main, then git fsck to verify
   ```
2. ```
   Use git unpack-objects to rebuild objects from pack files if available
   ```
3. ```
   As a last resort, clone the repo again and cherry-pick uncommitted changes from the broken clone
   ```

## 无效尝试

- **Delete the empty object file manually** — Breaks repository integrity; git will complain about missing objects and may refuse to operate. (90% 失败率)
- **Run git fsck without fixing first** — fsck only reports errors, does not repair; may lead to further confusion. (70% 失败率)
- **Re-clone the entire repository** — Overkill if only one object is corrupt; also loses uncommitted local changes. (40% 失败率)
