gc warning 🌿 Git

warning: There are too many unreachable loose objects; run 'git prune' to remove them.

Git’s automatic garbage collection found many unreachable objects and is asking you to prune.

Seen on: Git

Meaning

Frequent rebases/amends leave unreachable objects. A gc.log may keep re-triggering the warning.

Common causes

  • Lots of history rewriting
  • gc.log left from a previous failed auto-gc

⚡ Quick fix

  1. git prune && git gc
  2. Delete .git/gc.log if it keeps reappearing

Detailed fix by platform

Git

  1. git gc --prune=now && rm -f .git/gc.log

How to diagnose

  1. Log — Does .git/gc.log exist?
  2. Recent change — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.

🧠 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.