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

Fetching everything in another bare repo

From
Paul Smith <paul@mad-scientist.net>
Date
Mar 8, 2023, 22:39 UTC
Message-ID
<6215dde710670fdf0da3ba0549429eaa32db257b.camel@mad-scientist.net>
Apologies if this is the wrong list.

I have a tool that wants to preserve every commit and never garbage collect (there are references that need to be maintained to older commits/branches that have been deleted). This tool keeps its own bare clone, and disables all GC and maintenance on it.

Unfortunately a month or so ago, by accident someone re-cloned the primary copy of the repo that everyone else uses as this bare clone, which lost the old history.

The good news is that I have a copy of the original bare clone with all the history intact.

So now what I want to do is fetch the old data into the current bare clone (since the old clone doesn't have the newest stuff). And, I need to be sure that all commits are pulled, and kept, and nothing is cleaned up. I would also like any deleted branches to re-appear, but I don't want to change the location of any existing branches in the new repo.

Is it sufficient to run something like this:
  git fetch --no-auto-maintenance --no-auto-gc <path-to-old-clone>

?? Are there other options I should consider? Is it better to fetch the NEW clone into the OLD clone, than to fetch the old clone into the new clone (the new data is much more important to preserve)?

Since this is a one-off operation I don't care so much about making the fetch fast.

Thanks!
Next: Jeff King
Message 1 of 7 in “Fetching everything in another bare repo”
  1. Paul SmithMar 8, 2023
  2. Jeff KingMar 9, 2023
  3. Paul SmithMar 9, 2023
  4. Jeff KingMar 9, 2023
  5. Konstantin RyabitsevMar 9, 2023
  6. Jeff KingMar 10, 2023
  7. Paul SmithMar 9, 2023

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.