git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
To: Marco Maggesi <marco.maggesi@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: New to git
Date: Sun, 10 Apr 2011 00:41:05 +0200	[thread overview]
Message-ID: <vpqy63joxoe.fsf@bauges.imag.fr> (raw)
In-Reply-To: <BANLkTikCF7Kv2xVYmr3O_P2t1TAzEFxXiA@mail.gmail.com> (Marco Maggesi's message of "Sat, 9 Apr 2011 21:15:54 +0200")

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/

  parent reply	other threads:[~2011-04-09 22:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2011-04-08 22:54 ` Pushing to a "dumb" server (Re: New to git) Jonathan Nieder
  -- strict thread matches above, loose matches on Subject: below --
2007-08-27 19:43 new to git Kyle Rose
2007-08-27 20:11 ` J. Bruce Fields
2007-08-27 20:22 ` Andreas Ericsson
2007-08-27 20:36   ` Kyle Rose
2007-08-27 20:39   ` Junio C Hamano
2007-08-27 21:14     ` Andreas Ericsson
2007-09-05  5:56 ` Jan Hudec
2007-09-05  6:54 ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=vpqy63joxoe.fsf@bauges.imag.fr \
    --to=matthieu.moy@grenoble-inp.fr \
    --cc=git@vger.kernel.org \
    --cc=marco.maggesi@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).