{"thread":{"id":"8372","subject":"Fetch from remote A, push to remote B","startedAt":"2007-05-31T05:53:16Z","lastAt":"2007-06-01T03:51:26Z","messageCount":5,"participants":["Martin Langhoff"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"43676","messageId":"46a038f90705302253s68b70311h3feac7404fa23933@mail.gmail.com","threadId":"8372","inReplyTo":null,"subject":"Fetch from remote A, push to remote B","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2007-05-31T05:53:16Z","receivedAt":"2007-05-31T05:53:16Z","isPatch":false,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"Is there an easy way to get a \"passthrough\" repo setup so I can say on a cronjob\n\n  git-fetch remoteA\n  git-push ssh+git://host/path/to/repoB.git remotes/remoteA/<all>\n\nThe 2 repositories cannot talk to each other directly.\n\ncheers,\n\n\nmartin\n"},{"id":"43679","messageId":"46a038f90705310028y6f180214s9018f8af5e71d0ed@mail.gmail.com","threadId":"8372","inReplyTo":"46a038f90705302253s68b70311h3feac7404fa23933@mail.gmail.com","subject":"Re: Fetch from remote A, push to remote B","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2007-05-31T07:28:39Z","receivedAt":"2007-05-31T07:28:39Z","isPatch":false,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"On 5/31/07, Martin Langhoff <martin.langhoff@gmail.com> wrote:\n> Is there an easy way to get a \"passthrough\" repo setup so I can say on a cronjob\n>\n>   git-fetch remoteA\n>   git-push ssh+git://host/path/to/repoB.git remotes/remoteA/<all>\n\nAfter mucking about with stuff like...\n\nfind .git/refs/remotes/origin -type f -printf '%P\\0' | xargs -0\n-IHEADNAME git-push\ngit+ssh://git.catalyst.net.nz/var/git/moodle-r2-testing.git\norigin/HEADNAME:HEADNAME\n\nI figured out that a bare repo did the trick\n\n  # set things up\n  git-clone --bare git+ssh://host-a/bla.git bla-transfer.git\n\n  # on cron do\n  GIT_DIR=bla-transfer.git git-fetch git+ssh://host-a/bla.git\n  GIT_DIR=bla-transfer.git git-push --all git+ssh://host-b/bla.git\n\ncheers!\n\n\nmartin\n"},{"id":"43710","messageId":"46a038f90705311737u7e9a118v9b9865f63a4c6951@mail.gmail.com","threadId":"8372","inReplyTo":"46a038f90705310028y6f180214s9018f8af5e71d0ed@mail.gmail.com","subject":"Re: Fetch from remote A, push to remote B","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2007-06-01T00:37:51Z","receivedAt":"2007-06-01T00:37:51Z","isPatch":false,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"On 5/31/07, Martin Langhoff <martin.langhoff@gmail.com> wrote:\n>   # on cron do\n>   GIT_DIR=bla-transfer.git git-fetch git+ssh://host-a/bla.git\n>   GIT_DIR=bla-transfer.git git-push --all git+ssh://host-b/bla.git\n\nActually -- this doesn't quite work - the fetch grabs the new objects\nproperly but doesn't update the local heads on a bare repo.\n\ncheers,\n\n\n\nm\n"},{"id":"43712","messageId":"46a038f90705311852n136a2bfbwa943a65a43257a6e@mail.gmail.com","threadId":"8372","inReplyTo":"46a038f90705311737u7e9a118v9b9865f63a4c6951@mail.gmail.com","subject":"Re: Fetch from remote A, push to remote B","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2007-06-01T01:52:21Z","receivedAt":"2007-06-01T01:52:21Z","isPatch":false,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"On 6/1/07, Martin Langhoff <martin.langhoff@gmail.com> wrote:\n> On 5/31/07, Martin Langhoff <martin.langhoff@gmail.com> wrote:\n> >   # on cron do\n> >   GIT_DIR=bla-transfer.git git-fetch git+ssh://host-a/bla.git\n> >   GIT_DIR=bla-transfer.git git-push --all git+ssh://host-b/bla.git\n>\n> Actually -- this doesn't quite work - the fetch grabs the new objects\n> properly but doesn't update the local heads on a bare repo.\n\nShould this work?\n\nGIT_DIR=bla-transfer.git git-fetch git+ssh://host-a/bla.git\n+refs/heads/*:refs/heads/*\n\nEarlier discussions about mirroring tools (and Pasky's git-mirror)\nfinished with this being the recommended technique. Only - it does on\nme with\n\n* refusing to create funny ref 'heads/*' locally\n\ncheers,\n\n\n\nmartin\n"},{"id":"43715","messageId":"46a038f90705312051l663bc522r9c5c51bc803c2bc8@mail.gmail.com","threadId":"8372","inReplyTo":"46a038f90705311852n136a2bfbwa943a65a43257a6e@mail.gmail.com","subject":"Re: Fetch from remote A, push to remote B","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2007-06-01T03:51:26Z","receivedAt":"2007-06-01T03:51:26Z","isPatch":false,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"To finish off the soliloquy... effective mirroring with git\n\n  git-clone --bare git://host/repo.git mirror.git\n  git --git-dir=mirror.git config remote.origin.url git://host/repo.git\n  git --git-dir=mirror.git config remote.origin.fetch\n'+refs/heads/*:refs/heads/*'\n\n  and now, on cron...\n  git --git-dir=mirror.git fetch -u\n  git --git-dir=mirror.git remote prune origin\n\n(Thanks to Shawn Pearce for helping me figure out why it wasn't working for me!)\n\ncheers\n\n\n\nmartin\n"}]}