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

Re: New to git

From
Jeff King <peff@peff.net>
Date
Apr 8, 2011, 20:10 UTC
Message-ID
<20110408201024.GA15964@sigill.intra.peff.net>
In-Reply-To
<BANLkTimy-95OJGxU9XzcaR=0jTJWXOwsDg@mail.gmail.com>
On Fri, Apr 08, 2011 at 09:43:09PM +0200, Marco Maggesi wrote:
> Now I would like to setup a repository on a server and use it as a
> central point of distribution for a few other computers.
> As far as I can understand, the default mechanism for push / pull
> requires that git is installed on every machine, including the server.

Yes, it's the default, but there are other mechanisms that don't require server support. For example, rsync, and dumb http and ftp support. They're not as efficient, but they do work.

For pushing, they are not as convenient. The dumb http push support goes over DAV, so you must have a DAV server set up. Similarly, the rsync support does not (as far as I know) do rsync-over-ssh, but expects to connect to the rsync daemon directly.

But if you are just using the server as a distribution point for a single repository, it can be much simpler. For example, if you always just want to push and overwrite what is on the server (i.e., like a mirror), you can just use plain rsync outside of git. To avoid mirror lag, you do want to update the objects before the refs. So this:

  LOCAL=/path/to/repo.git
  REMOTE=server:path/to/repo.git
  rsync -a $LOCAL/objects/ $REMOTE/objects/
  rsync -a $LOCAL $REMOTE

would work. And then expose repo.git on the server via http or ftp, and clients can clone directly from it.

> My problem is that I can hardly install git on the server for several
> reasons that I will not explain here (also I'm not the administrator
> of the server).

You didn't list your reasons, so I'll assume they're good. But note that you don't need to be the administrator to accept a git push. You can build it as a regular user, and have git connect over ssh and run the server side.

Show 6 quoted lines
> For the moment I came only to the following idea: mount the remote
> repository via fuse-ssh and use the local installation of git to push
> / pull changes.
> Surely it is inefficient but I don't care too much (my repositories
> are small enough I think).
> Can you see other drawbacks of this solution?

That is inefficient, but I think it would work OK. If you are doing that, though, you are probably better off just rsyncing the whole result as I showed above. It's less inefficient and easier to set up (if you have rsync on the server, of course).

-Peff
Previous: Marco MaggesiNext: Marco Maggesi
Message 2 of 6 in “New to git”
  1. Marco MaggesiApr 8, 2011
  2. Jeff KingApr 8, 2011
  3. Marco MaggesiApr 9, 2011
  4. Dmitry PotapovApr 9, 2011
  5. Matthieu MoyApr 9, 2011
  6. Pushing to a "dumb" server (Re: New to git)Jonathan Nieder, Apr 8, 2011

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.