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

Re: rsync busy non-bare git repo 'source' to quiet

From
Jeff King <peff@peff.net>
Date
Mar 8, 2011, 22:38 UTC
Message-ID
<20110308223841.GA6648@sigill.intra.peff.net>
In-Reply-To
<4D76ABB1.9080001@gmail.com>
On Tue, Mar 08, 2011 at 04:20:33PM -0600, Neal Kreitzinger wrote:
> Rsync seems like a simpler solution and more accurate solution for
> creating a copy of an ecosystem of interrelated git repos colocated on
> the same box.
Sure. It is simpler, but not atomic unless you do a multi-stage rsync.
Show 9 quoted lines
> A previous post in the newsgroup states:
> > If you want your rsync backup to be fine, you need to follow some
> >ordering.  You need to copy the refs first (.git/packed-refs and
> >.git/refs/), then the loose objects (.git/objects/??/*), and then all
> >the rest.  If files are copied in a different order while some write
> >operations are performed on the source repository then you may end up
> >with an incoherent repository."
> 
> Would that work?

If you do it in that order, the end result will be a consistent repo. But during the copy, the refs at the destination will point to objects you don't have. I don't know if that matters for your case.

-Peff
Previous: Neal KreitzingerNext: Neal Kreitzinger
Message 4 of 5 in “rsync busy non-bare git repo 'source' to quiet”
  1. Neal KreitzingerMar 8, 2011
  2. Jeff KingMar 8, 2011
  3. Neal KreitzingerMar 8, 2011
  4. Jeff KingMar 8, 2011
  5. Neal KreitzingerMar 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.