Imagine a situation where you have two branches of the same project, with one part of the first branch dramatically refactored over the other one. But for a while you need to keep both branches functional, so you are doing bug fixes and crucial feature additions to both of them, sometimes in a not symmetrical way. And at some point there comes a moment when you have to merge refactored branch onto the original one. What is the best technique to use in a situation like this? Is it still possible to keep the history clean?
But more importantly what should have been my initial strategy in such scenario?