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

Re: Clone to an SSH destination

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Sep 3, 2012, 11:26 UTC
Message-ID
<CACBZZX7Pe5gsfpFTihE33a1Exia_4dbMQ9p_Xc_z4Ry=Et9KLA@mail.gmail.com>
In-Reply-To
<alpine.LFD.2.01.1209031059480.4753@sys880.ldn.framestore.com>
On Mon, Sep 3, 2012 at 12:21 PM, Mark Hills <Mark.Hills@framestore.com> wrote:
Show 11 quoted lines
> How do I clone a repo _to_ a new repo over SSH? I tried:
>
>   cd xx
>   git clone --bare . gitserver:/scm/xx.git
>   git clone --bare . ssh://gitserver/scm/xx.git
>
> This does not have the expected result, and instead a local path of the
> given name is created (eg. a 'gitserver:' directory)
>
> This seems to be a FAQ, but the only answer I can find (Google) is to
> login to the server and create the repo, setup a remote and push to it.

Basically Git doesn't support this yet, mainly because it could only be supported with the ssh or local transports.

With anything else it would break, so push can only assume that something on the other end can receive data, can update branch pointers etc. Not create a brand new repository.

You could of course supply your devs with an alias that ssh's to that server, does an init if needed, and then does a push.

Show 5 quoted lines
> This is quite cumbersome; we have a large team of devs who use a simple
> 'git clone' to an NFS directory, but we wish to retire NFS access.
>
> Is there a technical limiation preventing clone-to-ssh, or just something
> waiting to be implemented?

But I'm actually more curious about why you need this in the first place, there's a bunch of devs where I work as well, but they never have the need to create new repos on some NFS drive in this manner.

What are your devs doing when they do clone their current working directory to some NFS location, maybe there's a better way to do it.

Previous: Mark HillsNext: Mark Hills
Message 2 of 10 in “Clone to an SSH destination”
  1. Mark HillsSep 3, 2012
  2. Ævar Arnfjörð BjarmasonSep 3, 2012
  3. Mark HillsSep 3, 2012
  4. Konstantin KhomoutovSep 3, 2012
  5. Sitaram ChamartySep 3, 2012
  6. Enrico WeigeltSep 3, 2012
  7. Konstantin KhomoutovSep 3, 2012
  8. Sitaram ChamartySep 3, 2012
  9. Mark HillsSep 3, 2012
  10. Sitaram ChamartySep 3, 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.