I have this scenario which I do not think is uncommon but I am struggling to find an example of how it is done properly on the net.
We have our project, with a master branch. For my example lets say current state of the master identifies v1.5.0 of the project.
Now we decide to write v2.0.0, to which massive changes and rewrites will happen, files will be completely removed and deleted. This rewrite now takes place on a new branch we shall call unstable.
A week or so into development on unstable a feature and/or a bugfix needs to be added to v1.5.0, no problem we say new branch - write feature - merge with the master. The master is now at v1.6.0.
Now, this fix/feature does not apply to the new version of the project as the the entire project is being rewritten.
We complete v2.0.0 on the unstable branch which was originally based on v1.5.0 of the master branch which is now at say... v1.8.4 - how would you go about merging the unstable branch with the master branch without: destroying the history of versions 1.5 through to 1.8.4 or leaving artefacts from pre 2.0.0 versions in the merged branch and possibly breaking the new code written in v2.0.0?