# error: object file .git/objects/ab/cdef1234 is empty

- **ID:** `git/object-corruption-empty-file`
- **Domain:** git
- **Category:** data_error
- **Error Code:** `E001`
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A git object file in the repository is empty due to disk corruption, improper shutdown, or manual tampering.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| git 2.38 | active | — | — |
| git 2.43 | active | — | — |
| git 2.45 | active | — | — |

## Workarounds

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** (85% success)
   ```
   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** (75% success)
   ```
   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** (70% success)
   ```
   As a last resort, clone the repo again and cherry-pick uncommitted changes from the broken clone
   ```

## Dead Ends

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