(There's a lot of similar questions on this, and I've also read through various docs, but I can't find anything answering this specific issue.)
Given a repository with no remotes and no branches, with 20 commits on master.
The intent is to end up with an empty master, and all the commits on develop, but without a messy history.
Is there a difference between:
git branch --move master develop
git checkout --orphan master
And:
git checkout -b develop
git merge master
git checkout master
git reset --hard HEAD^20
?
The first option seems the simplest way to do this, but I've not seen it suggested anywhere - all the various things I've been reading tend to use variants of the second option (or rebasing, which I don't think applies here).
Does the first option do what I think it does, and does it have any benefits/drawbacks compared to the second option?
Is there an alternative even better way to achieve this?