corrupt object 🌿 Git

error: object file .git/objects/x is empty / fatal: loose object is corrupt

The local Git object database is corrupted — usually after a crash, disk full or sync tool interference.

Seen on: Git

Meaning

Cloud sync tools (Dropbox, OneDrive) and power loss can truncate object files. If the remote has everything, re-cloning is the quickest fix.

Common causes

  • Repo inside a cloud-synced folder
  • Disk full or crash during git operations
  • Hardware/storage issues

⚡ Quick fix

  1. Back up uncommitted work, then re-clone
  2. Try git fsck --full to see damage
  3. Fetch missing objects from the remote

Detailed fix by platform

Git

  1. git fsck --full

How to diagnose

  1. Damage — What does git fsck report?
  2. Location — Cloud-synced folder?

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.