From: Junio C Hamano <hidden> Date: 2016-06-15 22:42:13
Carl Baldwin [off-list ref] writes:
It might be cool to enable cloning to a remote over ssh if the remote
doesn't yet exist.
% git clone . machine:/path/to/new/repository
I wonder if that is:
$ ssh machine 'git clone '`hostname`:`pwd`' /path/to/new/repository'
Obviously you need a working git setup on the other end and
probably need to be much more careful shell-quoting if your
hostname and pwd has metacharacters, but...
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?
Hth,
Dscho
From: Nick Hengeveld <hidden> Date: 2016-06-15 22:42:13
On Thu, Nov 24, 2005 at 12:41:56AM +0100, Johannes Schindelin wrote:
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?
If sshd is running locally, you can forward a port back to yourself and
have the remote clone localhost:`pwd`. Assuming there's a way to clone
using a nonstandard port.
--
For a successful technology, reality must take precedence over public
relations, for nature cannot be fooled.
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
From: Andreas Ericsson <hidden> Date: 2016-06-15 22:42:13
Nick Hengeveld wrote:
On Thu, Nov 24, 2005 at 12:41:56AM +0100, Johannes Schindelin wrote:
quoted
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?
If sshd is running locally, you can forward a port back to yourself and
have the remote clone localhost:`pwd`. Assuming there's a way to clone
using a nonstandard port.
ssh://host.xz:port/path/to/repo.git
should work. If it doesn't I'll fix it.
--
Andreas Ericsson andreas.ericsson@op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231