threads / discuss / 59600

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

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

## tl;dr

One message between Apr 14, 2023 and Apr 14, 2023.

replies: 0people: 1as markdown or json

Nikita Kniazev· Apr 14, 2023, 23:50 UTC · lore
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

← back to recent threads