git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* bundles with multiple branches
@ 2009-08-23 20:36 Jeffrey Ratcliffe
  2009-08-23 20:52 ` Adam Brewster
  0 siblings, 1 reply; 5+ messages in thread
From: Jeffrey Ratcliffe @ 2009-08-23 20:36 UTC (permalink / raw
  To: git

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?

Regards

Jeff

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: bundles with multiple branches
  2009-08-23 20:36 bundles with multiple branches Jeffrey Ratcliffe
@ 2009-08-23 20:52 ` Adam Brewster
  2009-08-23 21:04   ` Jeffrey Ratcliffe
  0 siblings, 1 reply; 5+ messages in thread
From: Adam Brewster @ 2009-08-23 20:52 UTC (permalink / raw
  To: Jeffrey Ratcliffe; +Cc: git

On Sun, Aug 23, 2009 at 4:36 PM, Jeffrey
Ratcliffe<jeffrey.ratcliffe@gmail.com> wrote:
> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: bundles with multiple branches
  2009-08-23 20:52 ` Adam Brewster
@ 2009-08-23 21:04   ` Jeffrey Ratcliffe
  2009-08-24 21:42     ` Adam Brewster
  0 siblings, 1 reply; 5+ messages in thread
From: Jeffrey Ratcliffe @ 2009-08-23 21:04 UTC (permalink / raw
  To: Adam Brewster; +Cc: git

Thanks for the help

2009/8/23 Adam Brewster <adambrewster@gmail.com>:
> git remote add bundle /media/cdrom
> git config --replace-all remotes.bundle.fetch refs/heads/*:refs/remotes/bundle/*
> git config --add remotes.bundle.fetch refs/remotes/*:refs/remotes/*

On

$ git pull bundle

or

$ git fetch bundle

I get

fatal: '/media/cdrom': unable to chdir or not a git archive
fatal: The remote end hung up unexpectedly

Any ideas?

(I used the mount point of the USB stick where the bundles were but
the principle is the same)

Regards

Jeff

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: bundles with multiple branches
  2009-08-23 21:04   ` Jeffrey Ratcliffe
@ 2009-08-24 21:42     ` Adam Brewster
  2009-08-27 20:03       ` Jeffrey Ratcliffe
  0 siblings, 1 reply; 5+ messages in thread
From: Adam Brewster @ 2009-08-24 21:42 UTC (permalink / raw
  To: Jeffrey Ratcliffe; +Cc: git

>
> 2009/8/23 Adam Brewster <adambrewster@gmail.com>:
>> git remote add bundle /media/cdrom
>> git config --replace-all remotes.bundle.fetch refs/heads/*:refs/remotes/bundle/*
>> git config --add remotes.bundle.fetch refs/remotes/*:refs/remotes/*
>
> On
>
> $ git pull bundle
>
> or
>
> $ git fetch bundle
>
> I get
>
> fatal: '/media/cdrom': unable to chdir or not a git archive
> fatal: The remote end hung up unexpectedly
>

Sorry, that's supposed to be /media/cdrom/name-of-bundle

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: bundles with multiple branches
  2009-08-24 21:42     ` Adam Brewster
@ 2009-08-27 20:03       ` Jeffrey Ratcliffe
  0 siblings, 0 replies; 5+ messages in thread
From: Jeffrey Ratcliffe @ 2009-08-27 20:03 UTC (permalink / raw
  To: Adam Brewster; +Cc: git

2009/8/24 Adam Brewster <adambrewster@gmail.com>:
>> fatal: '/media/cdrom': unable to chdir or not a git archive
>> fatal: The remote end hung up unexpectedly
>>
>
> Sorry, that's supposed to be /media/cdrom/name-of-bundle

Thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-08-27 20:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-23 20:36 bundles with multiple branches Jeffrey Ratcliffe
2009-08-23 20:52 ` Adam Brewster
2009-08-23 21:04   ` Jeffrey Ratcliffe
2009-08-24 21:42     ` Adam Brewster
2009-08-27 20:03       ` Jeffrey Ratcliffe

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).