Git object-file-is-empty A loose object file exists on disk but holds zero bytes, breaking reads.

dev@local: ~/project — git
dev@local~/project$git status
error: object file is empty
Diagnostics Translation
A loose object file exists on disk but holds zero bytes, breaking reads.
waiting for resolution...
HighVersion Control System

Reviewed for reference consistency: August 11, 2026

Code is Safe

SECURE

Git has paused the operation to protect your code. No data has been lost or corrupted.

What To Know

This error means one object file exists only as a name: zero bytes reached the disk, so Git cannot inflate it, and the object must come from another copy of the repository.

Where Did It Fail?

Working Tree
Your local files
add
Staging Index
Prepared changes
commit
Local Repo
Commit history
push/fetch
Remote Server
GitHub/GitLab
The error involves the internal Git database or commit history structure.

Commands That Trigger This

A laptop died mid-commit and left an empty file under .git/objects/ab/
A cloud-sync folder restored object names from metadata before the content uploaded
A disk-full condition truncated object writes during a bulk import

Technical Background

01

The error line names the specific file, and it usually travels with the follow-up 'fatal: loose object ... is corrupt' once Git tries to use it. The distinction is diagnostic: an empty file says the write never happened, while corruption says bytes exist but disagree with their checksum.

02

The lost object is usually recoverable from elsewhere: the same content exists in any clone that fetched it, on a remote that received the push, or inside packfiles written before the incident. `git fsck --full` enumerates the damaged set before any repair.

Underlying Causes

The machine lost power during an object write
The disk filled up while objects were being written
File-sync or backup software materialized empty placeholders
A filesystem crash left the object file allocated but never filled

Frequently Asked Questions

An empty file proves the write never completed, while a corrupt file carries bytes that fail validation; both are unusable, but their causes and recoveries differ.

Sometimes — from packfiles, from identical content under other refs, or from a fetch of the same commit on a remote that holds a healthy copy.

Related Git States