git/list[1] front-page[2] threads[3] people[4] search[5] about
 

upload-pack not our ref

From
SDSam Darwin <samuel.d.darwin@gmail.com>
Date
Apr 12, 2023, 13:58 UTC
Message-ID
<CANEqPjHpaYvBWUy-pMi6ikhE6BeVooEBPK+O=cRzafD7o0UwaA@mail.gmail.com>
Hi,

I've just run into something which really looks like a bug in git. But I expect you will explain the reasoning that it's not a bug. Let's see. There is a superproject with submodules. Check it out locally. Update a few of the submodules: "git submodule update" Then, wait a few weeks. Upstream, commits change on both the superproject and submodules. Refresh the local copy: git pull It gives an error about one of the submodules: fatal: remote error: upload-pack: not our ref 19127b75621f423b572281f27b92ce4c7e50f1b5 The submodule that triggers the error already happens to be up-to-date, so it won't actually be updated or changed during "git pull". Nothing changed on that submodule, and it hadn't been force-pushed, as far as I can tell. No commits were made in the intervening time period on that specific submodule. (maybe tags were changed/updated...) On the superproject and some other modules, yes there were modifications. "19127b75621f423b572281f27b92ce4c7e50f1b5" is a mystery, and isn't the main commit sha (either before or after). Changing the command from "git pull" to "git pull --no-recurse-submodules ; git submodule update" fixes things. So, switching to a two-step process somehow avoids the error. What is the difference between "git pull" and the combination of "git pull --no-recurse-submodules ; git submodule update" ? ( that seems like the crux of the matter ). The error appears with git versions 2.36 and 2.40. Not git version 2.17.1. ( also interesting.. )

Thanks, Sam

Message 1 of 1 in “upload-pack not our ref”
  1. Sam DarwinApr 12, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.