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

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

From
Bryan Turner <bturner@atlassian.com>
Date
Aug 1, 2019, 22:40 UTC
Message-ID
<CAGyf7-F2qs2=51hdA-1BB=12w7GiwaVZ974eYKFzu-=OKj8Q=g@mail.gmail.com>
In-Reply-To
<CA+KyZp6mYx4C22syAu=W2Okf7tDwtQ+7vVUBaQ-2D70PTS+GaA@mail.gmail.com>

On Thu, Aug 1, 2019 at 1:52 PM Alexander Mills <alexander.d.mills@gmail.com> wrote:

Show 8 quoted lines
>
> Looking for help with this problem:
>
> https://stackoverflow.com/questions/57316783/git-clone-single-branch-does-not-work-for-sha-commit-ids
>
> Essentially looking for:
>
> git clone --single-commit

There's no such option, which will be why it doesn't work. I suspect the closest feature is a shallow clone, performed using git clone --depth=1. That's still not going to allow passing an arbitrary SHA-1, though; it'll only support a branch name, the same as --single-branch, which --depth implies (unless --no-single-branch is specified, at which point it fetches the depth for all branches).

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. Perhaps something like VFS for Git, if whatever hosting solution you're using supports it.

Hope this helps! Bryan

Previous: Alexander MillsNext: Jonathan Nieder
Message 2 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.