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