Re: Apply git bundle to source tree?
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Sep 18, 2020, 14:02 UTC
- Message-ID
- <20200918140236.GA1602321@nand.local>
- In-Reply-To
- <CAHpGcMJqmUmCR_u3fxSVppzwBo8_6RJG5-WLrXAWXm+OQ6_3bA@mail.gmail.com>
Hi Andreas,
On Fri, Sep 18, 2020 at 01:13:52PM +0200, Andreas Grünbacher wrote:
Show 8 quoted lines
> Hi, > > I'm wondering if there's a way to apply a particular head in a bundle > to a source tree, for example: > > $ git bundle create v5.9-rc1.bundle v5.8..v5.9-rc1 > $ cd linux-5.8 > $ git bundle APPLY ../5.9-rc1.bundle v5.9-rc1
Sort of. You can specify a refspec when fetching from the bundle to fetch only the objects you care about, like:
cd linux-5.8 git fetch /path/to/bundle 'refs/tags/v5.9-rc1:refs/tags/v5.9-rc1'
(or if you prefer, "git fetch /path/to/bundle 'tag v5.9-rc1'"). Then once you have the objects locally, you can merge it into your HEAD. You can do all of that in one step with:
git pull /path/to/bundle 'refs/tags/v5.9-rc1'
There's no such thing as 'git bundle apply' though, although I suspect 'git pull' is what you wanted anyway.
Thanks, Taylor