threads / discuss / 14371

git over rsync+ssh

Subject: git over rsync+ssh

## tl;dr

8 messages between Jul 9, 2008 and Jul 10, 2008.

replies: 7people: 5as markdown or json

Michael J Gruber· Jul 9, 2008, 14:01 UTC · lore

I want to put a git repo on a server where I have ssh access but failed to compile git (AIX 5.1, has libz.a but no .so nor headers; compiling prerequisite zlib failed, probably due to a botched build environment).

As far as I can see my only option for a private repo is using rsync over ssh.

Alas, the rsync:// transport of git seems to imply an rsync daemon connection.

How can I specify rsync over ssh as the git transport?

Alternatively, can I maybe compile the bits that git over ssh needs on the server side without zlib?

Michael
Mike Ralphson· Jul 9, 2008, 15:02 UTC · re: Michael J Gruber · lore

Re: git over rsync+ssh

2008/7/9 Michael J Gruber <michaeljgruber+gmane@fastmail.fm>:
> I want to put a git repo on a server where I have ssh access but failed to
> compile git (AIX 5.1, has libz.a but no .so nor headers; compiling
> prerequisite zlib failed, probably due to a botched build environment).

I can send you a binary to try if you'd like. It would be compiled on AIX 5.3 but I have to jump through hoops on several non-identically set-up servers here, so one might work for you.

# ldd /usr/local/bin/git
/usr/local/bin/git needs:
         /usr/lib/libc.a(shr.o)
         /usr/lib/libz.a(libz.so.1)
         /usr/lib/libiconv.a(shr4.o)
         /unix
         /usr/lib/libcrypt.a(shr.o)

# ar -t /usr/lib/libz.a libz.so.1 shr.o

Alternatively I can send you what gets installed from zlib-devel.rpm [1] which you might be able to install in your account's home directory, and then ./configure --with-zlib=PATH ; gmake might work for you.

Show 7 quoted lines
> As far as I can see my only option for a private repo is using rsync over
> ssh.
>
> ... [snipped the bits I know not]
>
> Alternatively, can I maybe compile the bits that git over ssh needs on the
> server side without zlib?

I don't think any git is going to get very far without zlib, as it won't understand (be able to verify) the object/pack format at all. I might be wrong about that though.

Mike
[1] ftp://ftp.software.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/zlib/zlib-1.2.3-4.aix5.2.ppc.rpm
Michael J Gruber· Jul 10, 2008, 10:06 UTC · re: Mike Ralphson · lore

Re: git over rsync+ssh

Mike Ralphson venit, vidit, dixit 09.07.2008 17:02:
Show 8 quoted lines
> 2008/7/9 Michael J Gruber <michaeljgruber+gmane@fastmail.fm>:
>> I want to put a git repo on a server where I have ssh access but failed to
>> compile git (AIX 5.1, has libz.a but no .so nor headers; compiling
>> prerequisite zlib failed, probably due to a botched build environment).
> 
> I can send you a binary to try if you'd like. It would be compiled on
> AIX 5.3 but I have to jump through hoops on several non-identically
> set-up servers here, so one might work for you.

Thanks for the offer. I found an AIX 4.3 box with a working build environment there, including zlib-devel, and I got git 1.5.6.2 compiled now (no tcltk, don't care). Runs fine on the AIX 5.1 box, I can clone and push happily. Yeah.

Michael
Avery Pennarun· Jul 9, 2008, 16:02 UTC · re: Michael J Gruber · lore

Re: git over rsync+ssh

On 7/9/08, Michael J Gruber <michaeljgruber+gmane@fastmail.fm> wrote:
Show 11 quoted lines
> I want to put a git repo on a server where I have ssh access but failed to
> compile git (AIX 5.1, has libz.a but no .so nor headers; compiling
> prerequisite zlib failed, probably due to a botched build environment).
>
>  As far as I can see my only option for a private repo is using rsync over
> ssh.
>
>  Alas, the rsync:// transport of git seems to imply an rsync daemon
> connection.
>
>  How can I specify rsync over ssh as the git transport?

I don't know if this will help in your case, but if it will be only you pushing to this repository, one option is to simply create a bare push repository on your local machine, and then manually just rsync+ssh it to the remote machine from the command line as a so-called "push" operation.

You would then make the repo available to others over http or something, which presumably you have available.

Would that work?
Have fun,
Avery
Teemu Likonen· Jul 9, 2008, 17:17 UTC · re: Avery Pennarun · lore

Re: git over rsync+ssh

Avery Pennarun wrote (2008-07-09 12:02 -0400):
Show 5 quoted lines
> I don't know if this will help in your case, but if it will be only
> you pushing to this repository, one option is to simply create a bare
> push repository on your local machine, and then manually just
> rsync+ssh it to the remote machine from the command line as
> a so-called "push" operation.

Again, I don't know if this is helpful for Michael, but this "manual" rsyncing can be done automatically via hooks/post-receive. Just like Avery said, "git push" to a bare repository in a local machine and this bare repo has post-receive hook which does "git update-server-info" and the rsyncing (or "sitecopy --update" or similar).

Michael J Gruber· Jul 10, 2008, 10:09 UTC · re: Teemu Likonen · lore

Re: git over rsync+ssh

Teemu Likonen venit, vidit, dixit 09.07.2008 19:17:
Show 13 quoted lines
> Avery Pennarun wrote (2008-07-09 12:02 -0400):
> 
>> I don't know if this will help in your case, but if it will be only
>> you pushing to this repository, one option is to simply create a bare
>> push repository on your local machine, and then manually just
>> rsync+ssh it to the remote machine from the command line as
>> a so-called "push" operation.
> 
> Again, I don't know if this is helpful for Michael, but this "manual"
> rsyncing can be done automatically via hooks/post-receive. Just like
> Avery said, "git push" to a bare repository in a local machine and this
> bare repo has post-receive hook which does "git update-server-info" and
> the rsyncing (or "sitecopy --update" or similar).

Thanks for your hints. Your posts combined made me understand the trick, using the "auxiliary" local repo for the hooks triggering the rsync. I'll hopefully remember it when I need it; in this case, a second repo would not have been very convenient, but I managed to get git running on the server side meanwhile.

Michael
Stephen Sinclair· Jul 9, 2008, 20:33 UTC · re: Michael J Gruber · lore

Re: git over rsync+ssh

On Wed, Jul 9, 2008 at 10:01 AM, Michael J Gruber <michaeljgruber+gmane@fastmail.fm> wrote:

Show 6 quoted lines
> I want to put a git repo on a server where I have ssh access but failed to
> compile git (AIX 5.1, has libz.a but no .so nor headers; compiling
> prerequisite zlib failed, probably due to a botched build environment).
>
> As far as I can see my only option for a private repo is using rsync over
> ssh.

Have you tried sshfs? It allows you to mount an ssh-accessible file system onto your local file system. This might make it possible to use your local git to access the remote account. Not sure of the implications for data integrity...

Steve
Michael J Gruber· Jul 10, 2008, 10:14 UTC · re: Stephen Sinclair · lore

Re: git over rsync+ssh

Stephen Sinclair venit, vidit, dixit 09.07.2008 22:33:
Show 10 quoted lines
> On Wed, Jul 9, 2008 at 10:01 AM, Michael J Gruber
> <michaeljgruber+gmane@fastmail.fm> wrote:
>> I want to put a git repo on a server where I have ssh access but failed to
>> compile git (AIX 5.1, has libz.a but no .so nor headers; compiling
>> prerequisite zlib failed, probably due to a botched build environment).
>>
>> As far as I can see my only option for a private repo is using rsync over
>> ssh.
> 
> Have you tried sshfs?

Yes, in other cases, with mixed success. In the present situation, I'm just John Doh User on both the client and the server, no sshfs available.

> It allows you to mount an ssh-accessible file system onto your local
> file system.
> This might make it possible to use your local git to access the remote account.
> Not sure of the implications for data integrity...

Integrity would be okay (single developper). But git is fast with a fast filesystem, not so fast on NFS; on sshfs? I'm not even sure sshfs is "filesystem-like" enough for git. Have you tried it with git?

Michael
P.S.: Problem solved differently now: got git going(TM) on the server.

← back to recent threads