From: Junio C Hamano <gitster@pobox.com>
To: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Cc: Jose de Leon <jdeleon@ensim.com>,
"git\@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: How to combine git repos with similar code and keep all branches and tags?
Date: Tue, 14 Apr 2015 10:25:06 -0700 [thread overview]
Message-ID: <xmqqfv8239n1.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <vpqr3rm8wn6.fsf@anie.imag.fr> (Matthieu Moy's message of "Tue, 14 Apr 2015 19:09:17 +0200")
Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
> Jose de Leon <jdeleon@ensim.com> writes:
>
>> For some unknown reason to me, our developers started a git project,
>> called Ver1, this was the first version. Then sometime later, they
>> created a new git repository called Ver2, the initial commit for Ver2
>> was essentially a copy of the code in Ver1 from the master. They
>> didn't clone it, they just copied the code at the latest point.
>
> This is why "graft points" were created, and then superseeded by "git
> replace".
>
> See http://git-scm.com/blog/2010/03/17/replace.html and
> http://git-scm.com/docs/git-replace
After setting up either grafts or replaces, I'd strongly recommend
running filter-branch or bfg to rewrite the history of the combined
result, and have the developers use that rewritten history _after_
removing the grafts (or replaces).
And if you are going to go that route, then graft is sufficient and
a lot more light-weight. The only advantage replace has over grafts
is that they can be transferred using "git push" and "git fetch"
(while grafts can be transferred with some file transfer mechanism
outside Git) but if you are rewriting the history, that advantage is
lost.
next prev parent reply other threads:[~2015-04-14 17:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-14 16:44 How to combine git repos with similar code and keep all branches and tags? Jose de Leon
2015-04-14 17:09 ` Matthieu Moy
2015-04-14 17:25 ` Junio C Hamano [this message]
2015-04-14 17:14 ` Max Horn
2015-04-14 17:31 ` Jose de Leon
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=xmqqfv8239n1.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=Matthieu.Moy@grenoble-inp.fr \
--cc=git@vger.kernel.org \
--cc=jdeleon@ensim.com \
/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.