I have a release branch that has moved on significantly from what is in master due to a complete re-work of code over the last 9 months or so.
Because release has diverged massively from master, there are so many conflicts when creating a PR into master. The current contents of master are essentially irrelevant now as I've been working on the release branch for so long. I'd like to reset master to the initial commit (which is just repo initialisation with a .gitignore file), whilst maintaining the same history (aside from an additional revert commit).
I've tried the following on a master-backup branch taken from master and then attempted to PR the release branch into this master-backup branch after running the commands:
git reset --hard <initial commit id> - this resets the history
git revert <INITIAL COMMIT ID>^..<LATEST COMMIT ID> - this has the same conflicts and doesn't quite push all of the files from release into master correctly.
I'm not sure what else to do now. My ultimate goal is to replace master's contents with release whilst maintaining master's current history, with the addition of maybe a revert commit and of course the merge from release to master.
Any help is very much appreciated.