In my project, I started with quite a few commits in the master
branch. After a couple of releases, I realised that the approach I was taking might not be what we want at all.
The new approach required a complete code rewrite so I decided to start in an orphan branch (a-new-beginning-branch
). I liked it and eventually, it became my de-facto master branch. Now I want to replace master
with a-new-beginning
.
I've found how to make the current Git branch a master branch but when following the steps shown there, I get the error message fatal: refusing to merge unrelated histories
. I know I could use the –allow-unrelated-histories
option but I don't really understand what it does and don't want to break things.
I've also found how to overwrite the master branch with a orphan branch but I don't want to delete the history in my master branch.
Ideally I would like to end up with a lineal history, but if that's not possible, I'll be also happy with some sort of a merge.
Any ideas will be much appreciated!