{"thread":{"id":"20708","subject":"bundles with multiple branches","startedAt":"2009-08-23T20:36:01Z","lastAt":"2009-08-27T20:03:41Z","messageCount":5,"participants":["Jeffrey Ratcliffe","Adam Brewster"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"121580","messageId":"30e395780908231336p403c2171ie383a81c3d1bb020@mail.gmail.com","threadId":"20708","inReplyTo":null,"subject":"bundles with multiple branches","fromName":"Jeffrey Ratcliffe","fromEmail":"jeffrey.ratcliffe@gmail.com","sentAt":"2009-08-23T20:36:01Z","receivedAt":"2009-08-23T20:36:01Z","isPatch":false,"sender":{"key":"jeffrey.ratcliffe@gmail.com","avatar":null},"body":"I tend to work on multiple machines that don't have direct access to\neach and therefore keep my git repositories in sync using bundles.\n\nThis works fine for single branches - but how can I set things up so\nthat I can just\n\n$ git pull <bundle>\n\nor\n\n$ git fetch <bundle>\n\nand have git update all branches?\n\nRegards\n\nJeff\n"},{"id":"121583","messageId":"c376da900908231352o5c5746c0h9e39b80adede66e8@mail.gmail.com","threadId":"20708","inReplyTo":"30e395780908231336p403c2171ie383a81c3d1bb020@mail.gmail.com","subject":"Re: bundles with multiple branches","fromName":"Adam Brewster","fromEmail":"adambrewster@gmail.com","sentAt":"2009-08-23T20:52:40Z","receivedAt":"2009-08-23T20:52:40Z","isPatch":false,"sender":{"key":"adambrewster@gmail.com","avatar":"https://avatars.githubusercontent.com/u/223816?v=4"},"body":"On Sun, Aug 23, 2009 at 4:36 PM, Jeffrey\nRatcliffe<jeffrey.ratcliffe@gmail.com> wrote:\n> I tend to work on multiple machines that don't have direct access to\n> each and therefore keep my git repositories in sync using bundles.\n>\n> This works fine for single branches - but how can I set things up so\n> that I can just\n>\n> $ git pull <bundle>\n>\n> or\n>\n> $ git fetch <bundle>\n>\n> and have git update all branches?\n>\n\n1. Make sure you've got all of the refs you want in the bundle.  I\nusually use `git bundle create ... --all`\n\n2. Set up a remote on the destination side with a url of wherever you\nkeep bundles (like /media/cdrom) and a fetch line like\nrefs/heads/*:refs/remotes/source/*\n\ngit remote add bundle /media/cdrom\ngit config --replace-all remotes.bundle.fetch refs/heads/*:refs/remotes/bundle/*\n\nSince your destination machine is likely not connected to the\ninternet, you may also want copy all of the remotes too.  I do that\nwith\n\ngit config --add remotes.bundle.fetch refs/remotes/*:refs/remotes/*\n\nBeware of the use of the name \"origin\" with setups like this.  If you\nhave branches under refs/remotes/origin/ on the machine you use to\ncreate the bundle, you will should make sure you don't try to copy\nrefs from refs/heads and refs/remotes/origin to the same place\n(because refs/remotes/origin is the natural place to store both).\n\nAdam\n"},{"id":"121584","messageId":"30e395780908231404k7240dbacu5c258d9816e35dd7@mail.gmail.com","threadId":"20708","inReplyTo":"c376da900908231352o5c5746c0h9e39b80adede66e8@mail.gmail.com","subject":"Re: bundles with multiple branches","fromName":"Jeffrey Ratcliffe","fromEmail":"jeffrey.ratcliffe@gmail.com","sentAt":"2009-08-23T21:04:06Z","receivedAt":"2009-08-23T21:04:06Z","isPatch":false,"sender":{"key":"jeffrey.ratcliffe@gmail.com","avatar":null},"body":"Thanks for the help\n\n2009/8/23 Adam Brewster <adambrewster@gmail.com>:\n> git remote add bundle /media/cdrom\n> git config --replace-all remotes.bundle.fetch refs/heads/*:refs/remotes/bundle/*\n> git config --add remotes.bundle.fetch refs/remotes/*:refs/remotes/*\n\nOn\n\n$ git pull bundle\n\nor\n\n$ git fetch bundle\n\nI get\n\nfatal: '/media/cdrom': unable to chdir or not a git archive\nfatal: The remote end hung up unexpectedly\n\nAny ideas?\n\n(I used the mount point of the USB stick where the bundles were but\nthe principle is the same)\n\nRegards\n\nJeff\n"},{"id":"121676","messageId":"c376da900908241442t385d492cm6925fd2d8abad848@mail.gmail.com","threadId":"20708","inReplyTo":"30e395780908231404k7240dbacu5c258d9816e35dd7@mail.gmail.com","subject":"Re: bundles with multiple branches","fromName":"Adam Brewster","fromEmail":"adambrewster@gmail.com","sentAt":"2009-08-24T21:42:21Z","receivedAt":"2009-08-24T21:42:21Z","isPatch":false,"sender":{"key":"adambrewster@gmail.com","avatar":"https://avatars.githubusercontent.com/u/223816?v=4"},"body":">\n> 2009/8/23 Adam Brewster <adambrewster@gmail.com>:\n>> git remote add bundle /media/cdrom\n>> git config --replace-all remotes.bundle.fetch refs/heads/*:refs/remotes/bundle/*\n>> git config --add remotes.bundle.fetch refs/remotes/*:refs/remotes/*\n>\n> On\n>\n> $ git pull bundle\n>\n> or\n>\n> $ git fetch bundle\n>\n> I get\n>\n> fatal: '/media/cdrom': unable to chdir or not a git archive\n> fatal: The remote end hung up unexpectedly\n>\n\nSorry, that's supposed to be /media/cdrom/name-of-bundle\n"},{"id":"121909","messageId":"30e395780908271303y3cff747dpce482379fd0c54cf@mail.gmail.com","threadId":"20708","inReplyTo":"c376da900908241442t385d492cm6925fd2d8abad848@mail.gmail.com","subject":"Re: bundles with multiple branches","fromName":"Jeffrey Ratcliffe","fromEmail":"jeffrey.ratcliffe@gmail.com","sentAt":"2009-08-27T20:03:41Z","receivedAt":"2009-08-27T20:03:41Z","isPatch":false,"sender":{"key":"jeffrey.ratcliffe@gmail.com","avatar":null},"body":"2009/8/24 Adam Brewster <adambrewster@gmail.com>:\n>> fatal: '/media/cdrom': unable to chdir or not a git archive\n>> fatal: The remote end hung up unexpectedly\n>>\n>\n> Sorry, that's supposed to be /media/cdrom/name-of-bundle\n\nThanks.\n"}]}