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

From: Jonathan Nieder <[email-masked]>
Date: Thu, 1 Aug 2019 19:43:22 -0700

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