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

Re: Pushing to a remote repo from a remote repo?

From
Jeff King <peff@peff.net>
Date
Apr 16, 2012, 14:47 UTC
Message-ID
<20120416144726.GA13688@sigill.intra.peff.net>
In-Reply-To
<CAAnwhhXPs0+GPExMu8TP0jbctMamg6FZW2ndcQMJbtqGetfyZw@mail.gmail.com>
On Sat, Apr 14, 2012 at 07:16:36PM -0400, Brian Cardarella wrote:
> Yes, I assumed the bits need to come through my system. I want to
> avoid cloning, pushing, then removing the repo. But it seems that is
> not possible. Thank you.

This isn't really a git problem, but rather a network proxying problem. You could solve it with netcat and ssh like:

  # forward port 5001 on our local box to ssh on the "source" box
  nc -lp 5001 -c 'nc $source 22' &
  # forward port 5001 on the destination box to our local forward,
  # and then start the clone
  ssh -R 5001:localhost:5001 $dest \
    'git clone ssh://localhost:5001/path/to/repo'

If the repository is accessible by http, then you can easily tweak it to forward to port 80. If, for some reason, you prefer push rather than fetch, you can create the tunnels in the reverse direction.

-Peff
Previous: Brian CardarellaNext: Jakub Narebski
Message 4 of 5 in “Pushing to a remote repo from a remote repo?”
  1. Brian CardarellaApr 14, 2012
  2. Carlos Martín NietoApr 14, 2012
  3. Brian CardarellaApr 14, 2012
  4. Jeff KingApr 16, 2012
  5. Jakub NarebskiApr 15, 2012

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.