7

I have two "branches", both of which started from the same code base, but both of which were imported to git after they diverged. The prior history is lost, and additionally both branches have extensive changes recorded in their git history.

What is a good strategy to approach merging features and bugfixes between these two branches in a manageable way?

Is there a tool that will assist me in separating differences in the original imports into meaningful commits?

4

1 回答 1

1

听起来你想保留历史。我会使用rebase --ontowith--preserve-merges将功能/错误移动到您要继续使用的分支。如果由于某种原因它们位于不同的结构中,请创建一个新分支,然后filter-branch对树进行操作以使结构相同。然后rebase --onto --preserve-merges就像在第一个场景中一样。

希望这可以帮助。

于 2011-01-26T21:05:59.860 回答