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

Re: bundles with multiple branches

From
Adam Brewster <adambrewster@gmail.com>
Date
Aug 23, 2009, 20:52 UTC
Message-ID
<c376da900908231352o5c5746c0h9e39b80adede66e8@mail.gmail.com>
In-Reply-To
<30e395780908231336p403c2171ie383a81c3d1bb020@mail.gmail.com>

On Sun, Aug 23, 2009 at 4:36 PM, Jeffrey Ratcliffe<jeffrey.ratcliffe@gmail.com> wrote:

Show 14 quoted lines
> I tend to work on multiple machines that don't have direct access to
> each and therefore keep my git repositories in sync using bundles.
>
> This works fine for single branches - but how can I set things up so
> that I can just
>
> $ git pull <bundle>
>
> or
>
> $ git fetch <bundle>
>
> and have git update all branches?
>
1. Make sure you've got all of the refs you want in the bundle.  I
usually use `git bundle create ... --all`
2. Set up a remote on the destination side with a url of wherever you
keep bundles (like /media/cdrom) and a fetch line like
refs/heads/*:refs/remotes/source/*

git remote add bundle /media/cdrom git config --replace-all remotes.bundle.fetch refs/heads/*:refs/remotes/bundle/*

Since your destination machine is likely not connected to the internet, you may also want copy all of the remotes too. I do that with

git config --add remotes.bundle.fetch refs/remotes/*:refs/remotes/*

Beware of the use of the name "origin" with setups like this. If you have branches under refs/remotes/origin/ on the machine you use to create the bundle, you will should make sure you don't try to copy refs from refs/heads and refs/remotes/origin to the same place (because refs/remotes/origin is the natural place to store both).

Adam
Previous: Jeffrey RatcliffeNext: Jeffrey Ratcliffe
Message 2 of 5 in “bundles with multiple branches”
  1. Jeffrey RatcliffeAug 23, 2009
  2. Adam BrewsterAug 23, 2009
  3. Jeffrey RatcliffeAug 23, 2009
  4. Adam BrewsterAug 24, 2009
  5. Jeffrey RatcliffeAug 27, 2009

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.