{"thread":{"id":"59585","subject":"upload-pack not our ref","startedAt":"2023-04-12T13:58:28Z","lastAt":"2023-04-12T13:58:28Z","messageCount":1,"participants":["Sam Darwin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"475217","messageId":"CANEqPjHpaYvBWUy-pMi6ikhE6BeVooEBPK+O=cRzafD7o0UwaA@mail.gmail.com","threadId":"59585","inReplyTo":null,"subject":"upload-pack not our ref","fromName":"Sam Darwin","fromEmail":"samuel.d.darwin@gmail.com","sentAt":"2023-04-12T13:58:13Z","receivedAt":"2023-04-12T13:58:28Z","isPatch":false,"sender":{"key":"samuel.d.darwin@gmail.com","avatar":null},"body":"Hi,\n\nI've just run into something which really looks like a bug in git.\nBut I expect you will explain the reasoning that it's not a bug.  Let's see.\nThere is a superproject with submodules. Check it out locally. Update\na few of the submodules: \"git submodule update\"\nThen, wait a few weeks.\nUpstream, commits change on both the superproject and submodules.\nRefresh the local copy:\ngit pull\nIt gives an error about one of the submodules:\nfatal: remote error: upload-pack: not our ref\n19127b75621f423b572281f27b92ce4c7e50f1b5\nThe submodule that triggers the error already happens to be\nup-to-date, so it won't actually be updated or changed during \"git\npull\".\nNothing changed on that submodule, and it hadn't been force-pushed, as\nfar as I can tell.  No commits were made in the intervening time\nperiod on that specific submodule.  (maybe tags were\nchanged/updated...)\nOn the superproject and some other modules, yes there were modifications.\n\"19127b75621f423b572281f27b92ce4c7e50f1b5\" is a mystery, and isn't the\nmain commit sha (either before or after).\nChanging the command from \"git pull\" to \"git pull\n--no-recurse-submodules ;  git submodule update\" fixes things.\nSo, switching to a two-step process somehow avoids the error.\nWhat is the difference between  \"git pull\" and the combination of \"git\npull --no-recurse-submodules ;  git submodule update\" ?  ( that seems\nlike the crux of the matter ).\nThe error appears with git versions 2.36 and 2.40.  Not git version\n2.17.1.  ( also interesting.. )\n\nThanks,\nSam\n"}]}