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

Re: How to undo git sparse-checkout set only for one directory?

From
Derrick Stolee <stolee@gmail.com>
Date
Jan 30, 2020, 15:08 UTC
Message-ID
<9b717655-5a89-6d88-b5c5-8bee9faf75aa@gmail.com>
In-Reply-To
<21812981580396191@vla3-a60e960147e7.qloud-c.yandex.net>
On 1/30/2020 9:56 AM, dk@tutunak.com wrote:
> After git sparse-checkout set <dir1> <dir2> <dir3> I want to disable sparse checkout only for one directroy - <dir2>. How can I do that? git sparse-checkout disable will do that for whole repository. 

I'm planning to add some "add" and "remove" subcommands to the sparse-checkout builtin soon, and those would allow you to modify the sparse-checkout cone one-by-one.

For the case you have now, you can try this:
	git sparse-checkout list >dirs.txt
	(edit dirs.txt to remove the directory you do not want)
	git sparse-checkout set --stdin <dirs.txt
Alternatively, you could do this abomination:
	git sparse-checkout list | grep -v "<dir2>" | git sparse-checkout set --stdin
I hope that helps.

Thanks, -Stolee

Previous: dk@tutunak.com
Message 2 of 2 in “How to undo git sparse-checkout set only for one directory?”
  1. dk@tutunak.comJan 30, 2020
  2. Derrick StoleeJan 30, 2020

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.