# Re: git and "dumb protocols"

10 messages from 2006-11-02 to 2006-11-03. Participants: Johannes Schindelin, Jakub Narebski, Petr Baudis, Daniel Barkalow, Matthieu Moy, Andy Whitcroft.
Thread: https://gitlist.dev/t/43111

## Matthieu Moy, 2006-11-02 10:36

Subject: git and "dumb protocols"
Message-ID: <vpqu01i16g8.fsf@ecrins.imag.fr>
URL: https://gitlist.dev/e/vpqu01i16g8.fsf%40ecrins.imag.fr

```
Hi,

Is it possible with git to push to a server on which git is not
installed, and if so, how?

From the man page of git, sftp doesn't seem supported, and ssh://
complains about git-receive-pack not being installed on the server.

The man page documents a rsync:// protocol, but

$ git push rsync://some.location.com/
fatal: I don't handle protocol 'rsync'
$ 

What am I missing?

Thanks,

-- 

```

## Andy Whitcroft, 2006-11-02 10:42

Subject: Re: git and "dumb protocols"
Message-ID: <4549CBB1.7010005@shadowen.org>
URL: https://gitlist.dev/e/4549CBB1.7010005%40shadowen.org
In-Reply-To: <vpqu01i16g8.fsf@ecrins.imag.fr>

```
Matthieu Moy wrote:
> Hi,
> 
> Is it possible with git to push to a server on which git is not
> installed, and if so, how?
> 
>>From the man page of git, sftp doesn't seem supported, and ssh://
> complains about git-receive-pack not being installed on the server.
> 
> The man page documents a rsync:// protocol, but
> 
> $ git push rsync://some.location.com/
> fatal: I don't handle protocol 'rsync'
> $ 
> 
> What am I missing?

To push only makes sense when you have git installed at the receiving
end.  It is the interaction between the source and destination git
instances which renders the push an effective optimisation.

If you are using rsync, then you can just rsync the whole repository out
and what is out there is as valid as your own copy.  Of course a repack
will make the whole thing changed and you'll pay on the next rsync.

git is designed with this use model involved, you 'git
update-server-info' then rsync the repo in-toto out to your http server
and it can be fetch'ed from (all be it less efficiently) by another
client.  All without any requirement for anything other than passive
data delivery at the server end.  Great if you don't have shell access etc.

-apw

```

## Petr Baudis, 2006-11-02 10:48

Subject: Re: git and "dumb protocols"
Message-ID: <20061102104848.GH20017@pasky.or.cz>
URL: https://gitlist.dev/e/20061102104848.GH20017%40pasky.or.cz
In-Reply-To: <vpqu01i16g8.fsf@ecrins.imag.fr>

```
  Hi,

Dear diary, on Thu, Nov 02, 2006 at 11:36:07AM CET, I got a letter
where Matthieu Moy <Matthieu.Moy@imag.fr> said that...
> Is it possible with git to push to a server on which git is not
> installed, and if so, how?

  yes, you can push using HTTP DAV - just push to an HTTP URL; make sure
you have git-http-push compiled, it is sometimes not compiled because it
unfortunately adds dependencies on couple of more libraries.

  Beware that this is inherently not safe for anonymous push access,
since malicious client with write access can destroy the repository. You
will want to protect write access to the repository by .htaccess file.

  I think a patch that would add support for pushing over sftp or some
other dumb protocol would be welcome. One problem is with proper locking
of ref updates (not sure how well would sftp cope with that), another is
that you will need to do git-update-server-info's job on the server
side.

  If you already have SSH access to the server, why not compile Git
there and install it to your $HOME, though?

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
#!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj
$/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1

```

## Johannes Schindelin, 2006-11-02 10:51

Subject: Re: git and "dumb protocols"
Message-ID: <Pine.LNX.4.63.0611021151340.1670@wbgn013.biozentrum.uni-wuerzburg.de>
URL: https://gitlist.dev/e/Pine.LNX.4.63.0611021151340.1670%40wbgn013.biozentrum.uni-wuerzburg.de
In-Reply-To: <vpqu01i16g8.fsf@ecrins.imag.fr>

```
Hi,

On Thu, 2 Nov 2006, Matthieu Moy wrote:

> Is it possible with git to push to a server on which git is not
> installed, and if so, how?

See

http://www.kernel.org/git/gitweb.cgi?p=git/git.git;a=blob;h=ba191569af9501117322e1881160226a74867007;hb=html;f=howto/setup-git-server-over-http.txt

Hth,
Dscho

```

## Johannes Schindelin, 2006-11-02 10:57

Subject: Re: git and "dumb protocols"
Message-ID: <Pine.LNX.4.63.0611021155500.1670@wbgn013.biozentrum.uni-wuerzburg.de>
URL: https://gitlist.dev/e/Pine.LNX.4.63.0611021155500.1670%40wbgn013.biozentrum.uni-wuerzburg.de
In-Reply-To: <20061102104848.GH20017@pasky.or.cz>

```
Hi,

On Thu, 2 Nov 2006, Petr Baudis wrote:

>   If you already have SSH access to the server, why not compile Git
> there and install it to your $HOME, though?

Could be a number of reasons:

- no compiler
- quota issues
- missing support for that particular platform
- time constraints
- etc

Happened to me.

Ciao,
Dscho

```

## Petr Baudis, 2006-11-02 11:02

Subject: Re: git and "dumb protocols"
Message-ID: <20061102110218.GI20017@pasky.or.cz>
URL: https://gitlist.dev/e/20061102110218.GI20017%40pasky.or.cz
In-Reply-To: <Pine.LNX.4.63.0611021155500.1670@wbgn013.biozentrum.uni-wuerzburg.de>

```
  Hi,

Dear diary, on Thu, Nov 02, 2006 at 11:57:16AM CET, I got a letter
where Johannes Schindelin <Johannes.Schindelin@gmx.de> said that...
> On Thu, 2 Nov 2006, Petr Baudis wrote:
> 
> >   If you already have SSH access to the server, why not compile Git
> > there and install it to your $HOME, though?
> 
> Could be a number of reasons:
> 
> - no compiler
> - quota issues

  good points.

> - missing support for that particular platform

  If not with conjunction with the following ("- time constraints"), it
would be superb to add support for that particular platform. :^)

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
#!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj
$/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1

```

## Matthieu Moy, 2006-11-02 12:04

Subject: Re: git and "dumb protocols"
Message-ID: <vpq4ptixdfj.fsf@ecrins.imag.fr>
URL: https://gitlist.dev/e/vpq4ptixdfj.fsf%40ecrins.imag.fr
In-Reply-To: <20061102104848.GH20017@pasky.or.cz>

```
Petr Baudis <pasky@suse.cz> writes:

>   yes, you can push using HTTP DAV - just push to an HTTP URL; make sure
> you have git-http-push compiled, it is sometimes not compiled because it
> unfortunately adds dependencies on couple of more libraries.

That's great. I don't need this right now, but having worked behind a
firewall + proxy, I know how appreciable it is to push with DAV ;-).

>   I think a patch that would add support for pushing over sftp or some
> other dumb protocol would be welcome. One problem is with proper locking
> of ref updates (not sure how well would sftp cope with that), another is
> that you will need to do git-update-server-info's job on the server
> side.

It should be possible (but not implemented AAUI) also to generate the
additional info of git-update-server-info on the client, isn't it?

>   If you already have SSH access to the server, why not compile Git
> there and install it to your $HOME, though?

I'll probably do, but my concern is broader than that. I like the
ability to use almost any webhosting service for my revision control.
GNU Arch was quite good at that, bzr is also (doesn't support webdav
very well yet, but read-only-HTTP, sftp and ftp are there), so I'd
like git to do the same.

And yes, there are tons of reasons not to install git on the server.
In particular, the fact that I'm not root there, and too lazy to do
more than "aptitude install git" with pleasure ;-).

-- 

```

## Jakub Narebski, 2006-11-02 12:12

Subject: Re: git and "dumb protocols"
Message-ID: <eicnbe$v6l$1@sea.gmane.org>
URL: https://gitlist.dev/e/eicnbe%24v6l%241%40sea.gmane.org
In-Reply-To: <vpq4ptixdfj.fsf@ecrins.imag.fr>

```
Matthieu Moy wrote:

> I'll probably do, but my concern is broader than that. I like the
> ability to use almost any webhosting service for my revision control.
> GNU Arch was quite good at that, bzr is also (doesn't support webdav
> very well yet, but read-only-HTTP, sftp and ftp are there), so I'd
> like git to do the same.

Well, git can fetch (read) via http, https, ftp, sftp, rsync, git, ssh+git;
it can push via http(s) with WebDAV, and ssh+git (ssh+git meaning via ssh,
with git installed on the server side).

BTW. rsync is considered obsolete, and suitable only for initial cloning,
perhaps.
-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git


```

## Petr Baudis, 2006-11-02 12:21

Subject: Re: git and "dumb protocols"
Message-ID: <20061102122125.GM20017@pasky.or.cz>
URL: https://gitlist.dev/e/20061102122125.GM20017%40pasky.or.cz
In-Reply-To: <vpq4ptixdfj.fsf@ecrins.imag.fr>

```
Dear diary, on Thu, Nov 02, 2006 at 01:04:16PM CET, I got a letter
where Matthieu Moy <Matthieu.Moy@imag.fr> said that...
> Petr Baudis <pasky@suse.cz> writes:
> >   I think a patch that would add support for pushing over sftp or some
> > other dumb protocol would be welcome. One problem is with proper locking
> > of ref updates (not sure how well would sftp cope with that), another is
> > that you will need to do git-update-server-info's job on the server
> > side.
> 
> It should be possible (but not implemented AAUI) also to generate the
> additional info of git-update-server-info on the client, isn't it?

Yes, that's what git-http-push does.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
#!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj
$/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1

```

## Daniel Barkalow, 2006-11-03 23:27

Subject: Re: git and "dumb protocols"
Message-ID: <Pine.LNX.4.64.0611031803370.9789@iabervon.org>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0611031803370.9789%40iabervon.org
In-Reply-To: <vpq4ptixdfj.fsf@ecrins.imag.fr>

```
On Thu, 2 Nov 2006, Matthieu Moy wrote:

> I'll probably do, but my concern is broader than that. I like the
> ability to use almost any webhosting service for my revision control.
> GNU Arch was quite good at that, bzr is also (doesn't support webdav
> very well yet, but read-only-HTTP, sftp and ftp are there), so I'd
> like git to do the same.

You should be able to put together the repository you want hosted locally 
and use any webhosting service updating procedure to update what's hosted. 
AFAIK, git.kernel.org is a completely dumb mirror of master.kernel.org, 
working like that.

The main thing is that you want "objects" to be updated before "refs", and 
you don't want to do any git operations during the mirroring. But it's not 
even that important, so long as whenever you leave the mirror for a while, 
it matches some final state (with respect to git) of the master.

What you actually care about the git-native stuff for is preparing the 
master image, so that you don't have random cruft from your working 
repository, and then you just want it to mirror efficiently.

	-Daniel

```
