git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* New to git
@ 2011-04-08 19:43 Marco Maggesi
  2011-04-08 20:10 ` Jeff King
  2011-04-08 22:54 ` Pushing to a "dumb" server (Re: New to git) Jonathan Nieder
  0 siblings, 2 replies; 6+ messages in thread
From: Marco Maggesi @ 2011-04-08 19:43 UTC (permalink / raw)
  To: git

Hi,
I'm considering to use git to track my sources.
So far I was able to use git on a single machine and play with its
basic features.

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.

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).
So I am looking for other solutions.

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?

Also I wonder if other kind of synchronizations are possible (rsync,
unison, ...).

Are there other obvious solutions that I'm missing?

Thanks,
Marco

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: New to git
  2011-04-08 19:43 New to git Marco Maggesi
@ 2011-04-08 20:10 ` Jeff King
  2011-04-09 19:15   ` Marco Maggesi
  2011-04-08 22:54 ` Pushing to a "dumb" server (Re: New to git) Jonathan Nieder
  1 sibling, 1 reply; 6+ messages in thread
From: Jeff King @ 2011-04-08 20:10 UTC (permalink / raw)
  To: Marco Maggesi; +Cc: git

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.

> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Pushing to a "dumb" server (Re: New to git)
  2011-04-08 19:43 New to git Marco Maggesi
  2011-04-08 20:10 ` Jeff King
@ 2011-04-08 22:54 ` Jonathan Nieder
  1 sibling, 0 replies; 6+ messages in thread
From: Jonathan Nieder @ 2011-04-08 22:54 UTC (permalink / raw)
  To: Marco Maggesi; +Cc: git, Jeff King

Hi,

Marco Maggesi wrote:

> 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).
> So I am looking for other solutions.

Have you looked into "git bundle"?

I should also mention that git can be run from ~/bin without trouble.
If you lack the ability to modify your $PATH, "git fetch" and "git
push" have --upload-pack and --receive-pack options that can be used
to specify alternate commands like '~/bin/git upload-pack'.

Ciao,
Jonathan

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: New to git
  2011-04-08 20:10 ` Jeff King
@ 2011-04-09 19:15   ` Marco Maggesi
  2011-04-09 19:35     ` Dmitry Potapov
  2011-04-09 22:41     ` Matthieu Moy
  0 siblings, 2 replies; 6+ messages in thread
From: Marco Maggesi @ 2011-04-09 19:15 UTC (permalink / raw)
  To: git

Hi Chris and Peff,

2011/4/8 Jeff King <peff@peff.net>:
> 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.

this is the solution I was looking for (but I where not sure that it worked).

> 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.

Well, the server is a very old machine and I didn't find easy to
compile git on it because of many missing dependencies (but I didn't
try very hard either).  A better solution would be to upgrade the
server.  But your solution is perfect meanwhile.

Thank you,
Marco

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: New to git
  2011-04-09 19:15   ` Marco Maggesi
@ 2011-04-09 19:35     ` Dmitry Potapov
  2011-04-09 22:41     ` Matthieu Moy
  1 sibling, 0 replies; 6+ messages in thread
From: Dmitry Potapov @ 2011-04-09 19:35 UTC (permalink / raw)
  To: Marco Maggesi; +Cc: git

On Sat, Apr 9, 2011 at 11:15 PM, Marco Maggesi <marco.maggesi@gmail.com> wrote:
>
> Well, the server is a very old machine and I didn't find easy to
> compile git on it because of many missing dependencies (but I didn't
> try very hard either).

Some time ago, I built git on an old machine running Linux (RedHat 8.0
but maybe some packages were upgraded). Here is the line that I used:

make NO_OPENSSL=1 NO_NSEC=1 NO_CURL=1 NO_TCLTK=1 NO_PYTHON=1

I needed git only to push and fetch to that repository, and it worked
well for me.

Dmitry

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: New to git
  2011-04-09 19:15   ` Marco Maggesi
  2011-04-09 19:35     ` Dmitry Potapov
@ 2011-04-09 22:41     ` Matthieu Moy
  1 sibling, 0 replies; 6+ messages in thread
From: Matthieu Moy @ 2011-04-09 22:41 UTC (permalink / raw)
  To: Marco Maggesi; +Cc: git

Marco Maggesi <marco.maggesi@gmail.com> writes:

> Hi Chris and Peff,
>
> 2011/4/8 Jeff King <peff@peff.net>:
>> 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.
>
> this is the solution I was looking for (but I where not sure that it
> worked).

It works, but "git push" does something that rsync can't: it will refuse
non-fast forward, i.e. refuse to override commits that you don't have
locally.

So, I'll just insist on the "if you are just using the server as a
distribution point" part. If you ever push from two different machines
to the server with rsync, you'll take the risk of loosing data.

If the server runs an HTTP server, an alternative is to push over
WebDAV, it doesn't require Git on the server. It's slow, but safer than
rsync.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-04-09 22:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-08 19:43 New to git Marco Maggesi
2011-04-08 20:10 ` Jeff King
2011-04-09 19:15   ` Marco Maggesi
2011-04-09 19:35     ` Dmitry Potapov
2011-04-09 22:41     ` Matthieu Moy
2011-04-08 22:54 ` Pushing to a "dumb" server (Re: New to git) Jonathan Nieder

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).