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

Re: Why not clone to a remote directory over SSH

From
Linus Torvalds <torvalds@osdl.org>
Date
Nov 24, 2005, 00:51 UTC
Message-ID
<Pine.LNX.4.64.0511231645100.13959@g5.osdl.org>
In-Reply-To
<Pine.LNX.4.63.0511240038001.11106@wbgn013.biozentrum.uni-wuerzburg.de>
On Thu, 24 Nov 2005, Johannes Schindelin wrote:
Show 8 quoted lines
> 
> On Wed, 23 Nov 2005, Junio C Hamano wrote:
> 
> > 	$ ssh machine 'git clone '`hostname`:`pwd`' /path/to/new/repository'
> 
> Obviously, this only works if the other side can connect to this side via 
> ssh. Hmm. Firewalls? Disabled sshd? `hostname` not reliably returning a 
> valid address for the remote side?
Well, you could also just script it and just do
	ssh machine 'mkdir -p /path/to/new/repository ;
		cd /path/to/new/repo;
		git-init-db'
	git push --all machine:/path/to/new/repository
	ssh machine 'cd /path/to/new/repo ; git checkout'

(and yes, we could obviously make this a "git-create-repo" command, and then you could do

	git-send-pack --exec=git-create-repo \
		machine:/path/to/new/repository
		$(git-rev-parse --all)
or something like that).
		Linus
Previous: Andreas Ericsson
Message 13 of 13 in “Why not clone to a remote directory over SSH”
  1. Carl BaldwinNov 23, 2005
  2. Nick HengeveldNov 23, 2005
  3. Andreas EricssonNov 23, 2005
  4. Nick HengeveldNov 23, 2005
  5. Johannes SchindelinNov 23, 2005
  6. Nick HengeveldNov 24, 2005
  7. Johannes SchindelinNov 24, 2005
  8. Nick HengeveldNov 25, 2005
  9. Junio C HamanoNov 23, 2005
  10. Johannes SchindelinNov 23, 2005
  11. Nick HengeveldNov 24, 2005
  12. Andreas EricssonNov 24, 2005
  13. Linus TorvaldsNov 24, 2005

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.