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

Re: Sparse checkouts

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Nov 7, 2010, 06:39 UTC
Message-ID
<AANLkTi=7jeeEw58SQOWmWUx54epWinTuTJE_h=bxcYvO@mail.gmail.com>
In-Reply-To
<loom.20101107T030122-536@post.gmane.org>
On Sun, Nov 7, 2010 at 9:04 AM, Uri Moszkowicz <uri@4refs.com> wrote:
Show 10 quoted lines
> Hi,
> I'm working with a repository with a very large number of files and Git is
> appealing because it officially supports sparse checkouts unlike the other
> DVCS tools. However, all of the usage examples that I've come across have
> you checkout the full repository and then prune the undesired files as such:
>
>  git clone <dir>
>  git config core.sparsecheckout true
>  echo "<dir>/" > .git/info/sparse-checkout
>  git read-tree -m -u HEAD
You can replace the last command with "git checkout" (no additional argument)
> I tried adding "-n" to the clone command but then none of the missing
> directories are checked out by read-tree.
Hmm.. it works fine here. Can you post the exact sequence of commands you used?
> I can manually check them out
> and everything seems to work fine but I can also manually check out a bunch
> of other directories and read-tree, reset, etc all seem to ignore the extra
> directory even though they aren't specified in the sparse-checkout file

Sparse checkout mode does not stop you from checking out non-sparse files. But all those files are not "seen" by git because of sparse checkout mode. They are ignored most of the time, except when git is going to overwrite them.

> Is this use mode just not well supported by git yet or am I missing something?
Sparse checkout support is pretty basic. Any suggestions are welcome.
-- 
Duy
Previous: Uri MoszkowiczNext: Nguyen Thai Ngoc Duy
Message 2 of 3 in “Sparse checkouts”
  1. Uri MoszkowiczNov 7, 2010
  2. Nguyen Thai Ngoc DuyNov 7, 2010
  3. Nguyen Thai Ngoc DuyNov 11, 2010

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.