#git repository A has commits A0, A1, ... An. Repository B has a galaxy brain dev who just copied the source files from commit A7 into a new repository and created B0, B1, ... Bn.

Since B0 and A7 are functionally identical, it should be possible to rebase B1...Bn onto A7, to make a new branch off A7 with the same changes as in B1...Bn, and then I can merge it with An. Except that repositories A and B have unrelated histories, thanks to aforementioned galaxy brained genius.

Is this even possible? Or should I just merge An and Bn with allow-unrelated-histories, and hope that the merge finds A7 to use as a base?

#help #programming #ask #question
@cy git replace --graft then rebase is what I see suggested online. I've never done this. You might want to try it on a couple other clones first. 😅
replace graft looks weird... what I did was a rebase, and it worked great except I had to meticulously resolve every single merge conflict in the history of B. Which probably broke everything, but eh. I can merge upstream now!

And OBVIOUTLY I have like 3 or 4 clones :p

$ git rebase --rebase-merges --onto A7 B1 Bn basically