git clone_error ai_generated true

fatal: refusing to fetch into branch because shallow update is not allowed

ID: git/shallow-update-not-allowed

Also available as: JSON · Markdown
88%Fix Rate
90%Confidence
50Evidence
2023-01-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
2 active

Root Cause

Git operation on a shallow clone that requires full history.

generic

Workarounds

  1. 95% success Unshallow the clone: git fetch --unshallow
    git fetch --unshallow

    Sources: https://git-scm.com/docs/git-fetch#Documentation/git-fetch.txt---unshallow

  2. 85% success Fetch specific depth: git fetch --depth=100 to get more history
    git fetch --depth=100 to get more history

    Sources: https://git-scm.com/docs/git-fetch#Documentation/git-fetch.txt---depthltdepthgt

Dead Ends

Common approaches that don't work:

  1. Delete repo and full clone every time 55% fail

    Wastes bandwidth for large repos

Error Chain

Frequently confused with: