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

git submodule ignores sparse-checkout?

From
Brad Larson <bklarson@gmail.com>
Date
Jul 16, 2026, 19:47 UTC
Message-ID
<CAJ5prAm+t2pVGjfqqU6c9aASYf7sa-jpxG8v5rezJNYx__xaWw@mail.gmail.com>
I feel like this is incorrect.  Curious if others agree.

sparse-checkout is fantastic for working in a subset of a large repository. But if that repository also happens to use git submodules, the sparse checkout configuration is ignored during submodule updates.

git 2.55.0, built from e9019fcafe00 Steps to reproduce (I chose rust - it has a lot of submodules) :

$ git clone --filter=blob:none --no-checkout https://github.com/rust-lang/rust.git $ cd rust $ git sparse-checkout set src/doc $ git checkout main (notice how we only have src/doc populated) $ git submodule update --init (initializes repositories in library/ and src/tools)

I think it would make sense for git submodule to only interact with the set of directories in the sparse checkout configuration. Would the maintainers be open to a commit which improves this behavior?

Thank you, Brad

Message 1 of 1 in “git submodule ignores sparse-checkout?”
  1. Brad LarsonJul 16, 2026

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.