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

Re: cannot clone --single-commit instead of --single-branch

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Aug 2, 2019, 02:43 UTC
Message-ID
<20190802024322.GC54514@google.com>
In-Reply-To
<CAGyf7-F2qs2=51hdA-1BB=12w7GiwaVZ974eYKFzu-=OKj8Q=g@mail.gmail.com>
Hi,
Bryan Turner wrote:
> Promisor remotes and other in-flight changes might help provide some
> of what you're looking for, but I'm not aware of any already-available
> solution.
You can do
	git clone --no-checkout --filter=blob:none $url repo
	cd repo
	git checkout $commit

That gives you commits and trees from other commits, but the only blobs it downloads are from the named commit.

Using the existing tree filtering features to limit the trees fetched and/or writing a patch for commit filtering are left as exercises to the reader.

Thanks and hope that helps, Jonathan

Previous: Bryan TurnerNext: Mike Hommey
Message 3 of 5 in “cannot clone --single-commit instead of --single-branch”
  1. Alexander MillsAug 1, 2019
  2. Bryan TurnerAug 1, 2019
  3. Jonathan NiederAug 2, 2019
  4. Mike HommeyAug 2, 2019
  5. Jonathan NiederAug 2, 2019

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.