0

Baseline: Two websites, one of which was created by copying the other, some time ago. Since then, many files were edited, some heavily, some are still identical.

Where I came in: I put both into Gits, started patching things up, making commits.

Now, I'd like to recombine the repos, realizing a lot of patches should really be shared. Ideally, I'd keep each project as branch A and branch B, sharing all the changes done to the parts that are still common, or easily merging changes that can still apply to the parts that changed but not by much.

How do I go about this, starting with two completely separate, but internally very similar repos?

  • Does this answer your question? [Allow merging unrelated histories in git rebase](https://stackoverflow.com/questions/43006544/allow-merging-unrelated-histories-in-git-rebase) – Stephen Newell Jun 12 '23 at 00:40
  • I think the duplicate answers the technical apart about getting `git` to do the merge (`--allow-unrelated-histories`). You'll probably have to do cleanup on your own to get common stuff in a common branch. – Stephen Newell Jun 12 '23 at 00:40
  • Right. I probably first need to go back to "initial" states of project A and B, make a diff and call one branch "base" and the other "fork", and from then apply current "project A" to "base", and "project B" to "fork". That cross-repo merge eludes me, though. – Sinus the Tentacular Jun 12 '23 at 00:57

0 Answers0