git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: "Kerry, Richard" <richard.kerry@atos.net>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Can I Insert some Ancient History into a repo?
Date: Wed, 02 Dec 2020 16:50:01 +0100	[thread overview]
Message-ID: <87o8jcus0m.fsf@evledraar.gmail.com> (raw)
In-Reply-To: <AM0PR02MB40811C5C2E8B13B63D06E4B49CF30@AM0PR02MB4081.eurprd02.prod.outlook.com>


On Wed, Dec 02 2020, Kerry, Richard wrote:

> I've read up on merging repositories and I can easily get L1 into the
> same repo as L2, as a separate line of development.  However, merging
> it is not the right thing to do, as that leaves me with L1 and L2
> having separate starting points, with a merge leading to there being
> only one head.  That's the opposite of what I want - I want to keep
> one starting point (that of L1), and branch L2 off it (with L2 ending
> up as master).

I've brought in existing repos into other repos like what you describe
you shouldn't be doing, "git merge --allow-unrelated-histories" exists
for a reason, you can just use it.

I do think you're starting from the wrong starting point though, maybe
not in your thinking, but your post just says you want to combine these,
and how to do it.

The reason I've done this in the past is for some practical
reason. E.g. you might want to arrange it so a "git blame" or "git log"
on a file traverses down the right path & history, or to be able to
refer to commits by SHA1.

Depending on what you actually want to with the end result merging or
using grafts might not be the best thing to do. E.g. a perfectly OK
thing in some cases is to just have a side-repo somewhere to keep the
old history, you can add it as a remote to do some ad-hoc inspection,
but never need to push a merger of the two to the current active repo.


  parent reply	other threads:[~2020-12-02 15:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-02 10:54 Can I Insert some Ancient History into a repo? Kerry, Richard
2020-12-02 11:15 ` Johannes Schindelin
2020-12-02 15:50 ` Ævar Arnfjörð Bjarmason [this message]
2021-03-12 15:37   ` Kerry, Richard
2021-03-13  9:59     ` Kerry, Richard

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=87o8jcus0m.fsf@evledraar.gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=richard.kerry@atos.net \
    /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).