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

Re: how to make "full" copy of a repo

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 30, 2015, 17:37 UTC
Message-ID
<xmqqbnjaxu70.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CACsJy8AN6X3oh2=yLn-szEApEMC+uQMmO6qBYbPrVNK1_d5tEQ@mail.gmail.com>
Duy Nguyen <pclouds@gmail.com> writes:
> This is true. But I wonder if we should (and can) support
> --super-mirror option (disabled by default), where reflog and stashes
> are kept, for backup purposes. We might keep unreferenced objects as
> well if it's not hard to do.

I doubt that we want to be in the business of filesystem backup. Is there a practical use case that is *not* "I am relocating out of this directory on this machine and will be using the other one I am making by copying"?

For the "I am relocating" scenario, rsync is the most suitable option. The caveat "activity at the original will leave the copied result incomplete" will apply to whatever transport method you use, but in the "I am relocating" scenario, you will have a period that the original is quiet (i.e. you stop using the original at some point before you start the copied one, and do not expect that the sequence to take zero down time).

In a sense, "super-mirror" is even worse, if it is doing some "Git activity" on the source which we may want to log, which means the original will never be quiet during the copying. Sure, send-pack may not currently not do any logging in the original repository, but depending on the reason why such a copy is being made, the original may even have a custom hook-based logging data left somewhere in the repository and for copying such a repository the repository owner would want to keep the logged data.

And if what super-mirror does is not considered a "Git activity" and somehow bypasses all the Git rules in the original repository, then what is the advantage of having it in Git in the first place, over using something like rsync?

Previous: Duy NguyenNext: Torsten Bögershausen
Message 6 of 9 in “how to make "full" copy of a repo”
  1. Christoph Anton MittererMar 28, 2015
  2. Kevin DMar 28, 2015
  3. Christoph Anton MittererMar 29, 2015
  4. Kevin DMar 29, 2015
  5. Duy NguyenMar 30, 2015
  6. Junio C HamanoMar 30, 2015
  7. Torsten BögershausenMar 28, 2015
  8. Ævar Arnfjörð BjarmasonMar 28, 2015
  9. Christoph Anton MittererMar 29, 2015

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.