shallow update not allowed 🌿 Git

! [remote rejected] main -> main (shallow update not allowed)

You pushed from a shallow clone to a remote that doesn’t accept shallow history.

Seen on: Git

Meaning

CI checkouts with depth=1 (or clones with --depth) lack full history; pushing to a new remote requires it.

Common causes

  • Pushing from a CI checkout with fetch-depth 1
  • Shallow clone mirrored to another remote

⚡ Quick fix

  1. Unshallow: git fetch --unshallow
  2. In GitHub Actions use actions/checkout with fetch-depth: 0

Detailed fix by platform

Git

  1. git fetch --unshallow

How to diagnose

  1. Clone — git rev-parse --is-shallow-repository
  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.