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

Add submodule specifying depth and branch at the same time won't work

From
Carlos Pita <carlosjosepita@gmail.com>
Date
Oct 12, 2015, 19:48 UTC
Message-ID
<CAELgYhcmzDEVRH9neGwZeqVBduL-nb=d+XoSMwRGKpmLUeX83g@mail.gmail.com>
For example, I can do:
git clone --depth 1 --branch devel git@gitlab.com:memeplex/bash.git
But if I try:
git submodule add --depth 1 -b devel git@gitlab.com:memeplex/bash.git
I get:

fatal: Cannot update paths and switch to branch 'devel' at the same time. Did you intend to checkout 'origin/devel' which can not be resolved as commit? Unable to checkout submodule 'src/aur/bash'

I think the devel branch is left outside the update because depth is just 1, but then the same could be said for the clone, which just works. The request should be interpreted as depth 1 inside devel branch.

Next: Stefan Beller
Message 1 of 3 in “Add submodule specifying depth and branch at the same time won't work”
  1. Carlos PitaOct 12, 2015
  2. submodule: Test a shallow branchStefan Beller, Oct 12, 2015
  3. Fwd: [PATCH] submodule: Test a shallow branchStefan Beller, Oct 12, 2015

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.