git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Paul Smith <paul@mad-scientist.net>
To: git@vger.kernel.org
Subject: Fetching everything in another bare repo
Date: Wed, 08 Mar 2023 17:39:07 -0500	[thread overview]
Message-ID: <6215dde710670fdf0da3ba0549429eaa32db257b.camel@mad-scientist.net> (raw)

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!

             reply	other threads:[~2023-03-08 22:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-08 22:39 Paul Smith [this message]
2023-03-09  6:41 ` Fetching everything in another bare repo 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

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=6215dde710670fdf0da3ba0549429eaa32db257b.camel@mad-scientist.net \
    --to=paul@mad-scientist.net \
    --cc=git@vger.kernel.org \
    /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).