git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Fetching everything in another bare repo
@ 2023-03-08 22:39 Paul Smith
  2023-03-09  6:41 ` Jeff King
  0 siblings, 1 reply; 7+ messages in thread
From: Paul Smith @ 2023-03-08 22:39 UTC (permalink / raw)
  To: git

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!

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

end of thread, other threads:[~2023-03-10  9:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-08 22:39 Fetching everything in another bare repo Paul Smith
2023-03-09  6:41 ` Jeff King
2023-03-09 13:55   ` Paul Smith
2023-03-09 15:35     ` Jeff King
2023-03-09 17:57       ` Konstantin Ryabitsev
2023-03-10  9:04         ` Jeff King
2023-03-09 18:15       ` Paul Smith

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 NNTP newsgroup(s).