{"thread":{"id":"30246","subject":"Pushing to a remote repo from a remote repo?","startedAt":"2012-04-14T22:08:59Z","lastAt":"2012-04-16T14:47:26Z","messageCount":5,"participants":["Brian Cardarella","Carlos Martín Nieto","Jakub Narebski","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"189296","messageId":"CAAnwhhWTcfOi+qqXPnGNXSKHbFh5L=+6eSKaaex5mq6VTwSxEw@mail.gmail.com","threadId":"30246","inReplyTo":null,"subject":"Pushing to a remote repo from a remote repo?","fromName":"Brian Cardarella","fromEmail":"brian@dockyard.com","sentAt":"2012-04-14T22:08:59Z","receivedAt":"2012-04-14T22:08:59Z","isPatch":false,"sender":{"key":"brian@dockyard.com","avatar":null},"body":"So I have a destination repo that is remote. And I have a source repo\nthat is also remote. I would like my local machine to act as a proxy\nto allow me to push to the destination from the source without ever\ndownload the repo to my machine. Is this possible?\n"},{"id":"189300","messageId":"1334444541.7825.1.camel@beez.lab.cmartin.tk","threadId":"30246","inReplyTo":"CAAnwhhWTcfOi+qqXPnGNXSKHbFh5L=+6eSKaaex5mq6VTwSxEw@mail.gmail.com","subject":"Re: Pushing to a remote repo from a remote repo?","fromName":"Carlos Martín Nieto","fromEmail":"cmn@elego.de","sentAt":"2012-04-14T23:02:21Z","receivedAt":"2012-04-14T23:02:21Z","isPatch":false,"sender":{"key":"cmn@elego.de","avatar":"https://avatars.githubusercontent.com/u/335443?v=4"},"body":"On Sat, 2012-04-14 at 18:08 -0400, Brian Cardarella wrote:\n> So I have a destination repo that is remote. And I have a source repo\n> that is also remote. I would like my local machine to act as a proxy\n> to allow me to push to the destination from the source without ever\n> download the repo to my machine. Is this possible?\n\nUsing your computer as a proxy and avoiding downloading the information\nto your computer are mutually exclusive goals.\n\nAt any rate, git doesn't support this kind of operation. If you want to\nmove data from A to B, you need to push from A or fetch from B (or fetch\nfrom A to C and then push from C to A).\n\n   cmn\n\n"},{"id":"189302","messageId":"CAAnwhhXPs0+GPExMu8TP0jbctMamg6FZW2ndcQMJbtqGetfyZw@mail.gmail.com","threadId":"30246","inReplyTo":"1334444541.7825.1.camel@beez.lab.cmartin.tk","subject":"Re: Pushing to a remote repo from a remote repo?","fromName":"Brian Cardarella","fromEmail":"brian@dockyard.com","sentAt":"2012-04-14T23:16:36Z","receivedAt":"2012-04-14T23:16:36Z","isPatch":false,"sender":{"key":"brian@dockyard.com","avatar":null},"body":"Yes, I assumed the bits need to come through my system. I want to\navoid cloning, pushing, then removing the repo. But it seems that is\nnot possible. Thank you.\n\n- Brian\n\nOn Sat, Apr 14, 2012 at 7:02 PM, Carlos Martín Nieto <cmn@elego.de> wrote:\n> On Sat, 2012-04-14 at 18:08 -0400, Brian Cardarella wrote:\n>> So I have a destination repo that is remote. And I have a source repo\n>> that is also remote. I would like my local machine to act as a proxy\n>> to allow me to push to the destination from the source without ever\n>> download the repo to my machine. Is this possible?\n>\n> Using your computer as a proxy and avoiding downloading the information\n> to your computer are mutually exclusive goals.\n>\n> At any rate, git doesn't support this kind of operation. If you want to\n> move data from A to B, you need to push from A or fetch from B (or fetch\n> from A to C and then push from C to A).\n>\n>   cmn\n>\n"},{"id":"189325","messageId":"m3lilx9uhf.fsf@localhost.localdomain","threadId":"30246","inReplyTo":"CAAnwhhWTcfOi+qqXPnGNXSKHbFh5L=+6eSKaaex5mq6VTwSxEw@mail.gmail.com","subject":"Re: Pushing to a remote repo from a remote repo?","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2012-04-15T10:09:55Z","receivedAt":"2012-04-15T10:09:55Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Brian Cardarella <brian@dockyard.com> writes:\n\n> So I have a destination repo that is remote. And I have a source repo\n> that is also remote. I would like my local machine to act as a proxy\n> to allow me to push to the destination from the source without ever\n> download the repo to my machine. Is this possible?\n\nFirst, you can set up either SSH tunnel (for SSH transport), or HTTP\nproxy (`http_proxy`[1] environment variable or `http.proxy` config\nvariable[2] for HTTP transport, both smart and dumb), or git proxy\n(`core.gitproxy`, e.g. netcat or ssh, for git:// protocol)\n\nSecond, you can configure repository using hooks so that pushing to\nsaid intermediate repository would push to destination repository.  In\nthis solution you would have repository on disk on intermediate\nmachine, but you can avoid manual transfer to and from intermediate\nmachine.\n\n[1] curl(1) manpage, the \"Environment\" section\n[2] git-config(1) manpage\n\nHTH\n-- \nJakub Narebski\n"},{"id":"189407","messageId":"20120416144726.GA13688@sigill.intra.peff.net","threadId":"30246","inReplyTo":"CAAnwhhXPs0+GPExMu8TP0jbctMamg6FZW2ndcQMJbtqGetfyZw@mail.gmail.com","subject":"Re: Pushing to a remote repo from a remote repo?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-04-16T14:47:26Z","receivedAt":"2012-04-16T14:47:26Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Apr 14, 2012 at 07:16:36PM -0400, Brian Cardarella wrote:\n\n> Yes, I assumed the bits need to come through my system. I want to\n> avoid cloning, pushing, then removing the repo. But it seems that is\n> not possible. Thank you.\n\nThis isn't really a git problem, but rather a network proxying problem.\nYou could solve it with netcat and ssh like:\n\n  # forward port 5001 on our local box to ssh on the \"source\" box\n  nc -lp 5001 -c 'nc $source 22' &\n\n  # forward port 5001 on the destination box to our local forward,\n  # and then start the clone\n  ssh -R 5001:localhost:5001 $dest \\\n    'git clone ssh://localhost:5001/path/to/repo'\n\nIf the repository is accessible by http, then you can easily tweak it to\nforward to port 80. If, for some reason, you prefer push rather than\nfetch, you can create the tunnels in the reverse direction.\n\n-Peff\n"}]}