From: Pete Wyckoff <pw@padd.com>
To: git@vger.kernel.org
Subject: refs/replace advice
Date: Fri, 29 Jul 2011 08:31:22 -0700 [thread overview]
Message-ID: <20110729153122.GA4535@padd.com> (raw)
I've got two near-identical git repos, both imported from
gigantic upstream p4 repos. They started at slightly different
times so have different commit SHA1s, even though the tree
contents are the same. I can't filter-branch either of them; too
many users already.
I'm trying to use "git replace" to avoid cloning the entire set
of duplicate commits across a slow inter-site link. Like this:
...---A----B----C site1/top
\
D---E---F site1/proj
...---A'---B'---C' site2/top
It is true that "git diff C C'" is empty: they are identical.
This set of commands, run from site2, clones most of the repo
locally (up to C'), then grabs the few changes D..F from the
faraway site1:
git clone /path/to/site2.git repo
cd repo
git remote add -f site1 /path/to/faraway/site1.git
But it causes an entire fetch of all commits because C != C'.
I'd prefer it just to fetch D, E and F. So I try:
git refs replace A' A
but it still fetches everything. I toyed with grafting
site1's A on top of the parent of our local A':
echo A A'^ > .git/info/grafts
no luck.
I thought maybe I could "git fetch --depth=N" where N would cover
the range A'..site2/top, then replace. But testing with "git
fetch --depth=3" still wants to fetch 100k objects.
Any ideas?
-- Pete
next reply other threads:[~2011-07-29 15:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-29 15:31 Pete Wyckoff [this message]
2011-07-29 15:49 ` refs/replace advice Johannes Sixt
2011-07-29 22:46 ` Pete Wyckoff
2011-08-02 21:54 ` Pete Wyckoff
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110729153122.GA4535@padd.com \
--to=pw@padd.com \
--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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.