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

Sparse worktree always contains root files

From
JØJeppe Øland <joland@gmail.com>
Date
Mar 13, 2024, 18:16 UTC
Message-ID
<CA+osTZWsGv01xinFPKbTQOF9mpvfwWs4wJczHSZXLdRxf1OmwA@mail.gmail.com>
Hi there,

I'm trying to use sparse checkouts in a large project, and one oddity (bug?) came up.

If I do a normal full clone of a repository, then do:
    git worktree add ../sparse --no-checkout
    cd ../sparse
    git sparse-checkout set somepath
    git checkout
Now indeed it is a sparse worktree, but the files from the root
directory are also there.

This also happens with traditional (non-worktree) partial clones. (I did both shallow, blob-less and tree-less, and all of them behave the same way)

Regards, -Jeppe

Next: Junio C Hamano
Message 1 of 2 in “Sparse worktree always contains root files”
  1. Jeppe ØlandMar 13, 2024
  2. Junio C HamanoMar 13, 2024

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.