Re: Newbie experience with push over ssh

From: Andreas Ericsson <ae@op5.se>
Date: 2007-02-16 02:35:29
Bill Lear wrote:
> On Wednesday, February 14, 2007 at 16:10:45 (+0000) Joseph Wakeling writes:
>> Matthias Lederhofer wrote:
>>> I don't think there is any way to 'clone to remote'.  You'd have to
>>> ssh to the other machine and clone from there, or you can just create
>>> an empty repository on the remote host and push the stuff into it.
>> I remember coming across the same issue as Matthieu and never got round
>> to solving it.  In my case the desire is to upload the code onto a
>> remote machine---in particular a cluster where I run simulations.  I
>> don't particularly need that remote code to be in a repo or otherwise,
>> since it's only there to be run, not edited.
>>
>> As far as I know I have no way of installing git on that machine.
>> Perhaps I could install it locally but I suspect the sysadmin would not
>> be supportive.
>>
>> So, is there a way of using git to upload my code to a machine without a
>> repo ready-prepared?
> 
> If you must ...
> 
> % cat ~/.gitconfig
> [alias]
> 	scp !scp
> 	rcp !rcp
> % git scp -rp . me@remotehost:/directory
>

:-)

Perhaps a better solution would be to do

git archive --format=tar --prefix=project/ | bzip2 -f9 | \
	ssh user@remote -C "cat > project.tar.bz2"

Then unpack and build as usual on the remote end. Works a treat and is
currently the gist of the only line in my "push-to-web" script (the rest
of it just extends the command to run to also unpack the tarball).

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Fri Feb 16 02:36:16 2007

This archive was generated by hypermail 2.1.8 : 2007-02-16 02:39:26 EST