Skip to content
Discussion options

You must be logged in to vote

Why This Happens

This happens because GitHub's Git servers do not enable uploadpack.allowReachableSHA1InWant or uploadpack.allowAnySHA1InWant on public or private repositories. Instead, GitHub only enables uploadpack.allowTipSHA1InWant (along with Git protocol v2 ref advertisements).

When you run git submodule update --init --depth 1:

  1. Git attempts a shallow fetch (--depth=1) by passing the exact pinned commit SHA directly to the remote server.
  2. Because that commit is not the current tip of any branch or tag (i.e., it is an older commit on main that isn't explicitly advertised as a ref), GitHub's git-upload-pack rejects the direct SHA request with:
    error: Server does not allow request for …

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@khizerahmadchohan
Comment options

Answer selected by khizerahmadchohan
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Search and Navigation Search, navigate, and understand code on GitHub Question Ask and answer questions about GitHub features and usage Welcome 🎉 Used to greet and highlight first-time discussion participants. Welcome to the community! source:ui Discussions created via Community GitHub templates Other Features and Feedback Discussions that fall into "Other" category
3 participants