Re: Track git blame through two unrelated histories
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 9, 2023, 18:35 UTC
- Message-ID
- <xmqqwn3pai2d.fsf@gitster.g>
- In-Reply-To
- <CAAo-ADZBBRxSROeAwrA9o30Etf3QQhLCaWQJtVsChVwT-AbgTg@mail.gmail.com>
Ilia Pozhilov <ilyapoz@gmail.com> writes:
Show 9 quoted lines
> So let's say I add two remotes and fetch all the commits, but they > look like this: > > A->B-> .... . . . -> Z history1 > > 1 -> 2 -> ..... -> 0 history2 > > and file contents in commits Z and 1 are exactly the same, but the > commits themselves are completely unrelated for git.
You mean you want to pretend that history "2 -> ... -> 0" was built on top of Z? Here I am assuming that time flows from left to right in the picture.
If so, you should be able to graft the histories together, perhaps?
Totally untested but something like
$ git replace --graft 1 Z
based on my reading of "git help replace" should allow you to pretend that Z happened immediately before 1.