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

Shallow submodules update not working?

From
GPGautier Pelloux-Prayer <gautier.pelloux@gmail.com>
Date
Sep 17, 2015, 11:28 UTC
Message-ID
<68A9767C-BC5B-479D-B212-BEB1CDF3E7E8@gmail.com>
Using git version 2.3.8 (Apple Git-58), when I try to clone a repository with submodules using option --depth 1, I get two different behaviors for two different commands:

# 1 - using git clone --recursive directly (OK) # repository last ref is cloned as well as its submodules $ git submodule clone git://repository --depth 1 --recursive

# 2 - using git clone then git submodule update (KO) # repository is cloned, then submodules are cloned too but an invalid reference is fetched leading to "fatal: reference is not a tree: <submodule ref>" $ git submodule clone git://repository --depth 1 $ cd repository $ git submodule update --init --recursive --depth 1 #error

I am wondering if the second scenario has the intended behavior, or if it should behave as the first solution. 
If this is the intented behavior, is it possible to retrieve a shallow version of submodules within an existing git repository, or the only solution is to clone the whole project with --depth 1 option?
Thanks, 
Message 1 of 1 in “Shallow submodules update not working?”
  1. Gautier Pelloux-PrayerSep 17, 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.