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

`submodule update --remote` fetches default branch instead of `submodule.*.branch`

From
NKNikita Kniazev <nok.raven@gmail.com>
Date
Apr 14, 2023, 23:50 UTC
Message-ID
<CAPFiOxax-=PRUBCSOPH=9=UpERQLEJw+pO1Pg+JndM63JyGDAw@mail.gmail.com>
Hello,
When I do
  git clone -j10 --depth=1 --branch=develop --no-tags --single-branch
--recurse-submodules --shallow-submodules --remote-submodules
https://github.com/boostorg/boost.git .
Or
  git clone --depth=1 --shallow-submodules --branch=develop
https://github.com/boostorg/boost.git .
  git submodule update --init --remote --checkout --recommend-shallow
--recursive --single-branch --jobs 10 --depth 1
I get the error:
  fatal: Unable to find current origin/develop revision in submodule
path 'libs/callable_traits'

In the trace I see that git clone is called without the `--branch=develop` even though `git branch` reports `develop` and `.gitmodules` sets 'branch = .' on every submodule.

  trace: built-in: git submodule--helper clone --require-init --path
libs/callable_traits --name callable_traits --url
https://github.com/boostorg/callable_traits.git --depth=1
--single-branch
  trace: built-in: git clone --no-checkout --depth 1
--separate-git-dir /home/nick/boost-repo/.git/modules/callable_traits
--single-branch -- https://github.com/boostorg/callable_traits.git
/home/nick/boost-repo/libs/callable_traits
I tried different versions:
  git version 2.34.1
  git version 2.39.2.windows.1
  git version 2.40.0.windows.1
Message 1 of 1 in “`submodule update --remote` fetches default branch instead of `submodule.*.branch`”
  1. Nikita KniazevApr 14, 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.