$ git checkout --orphan NEWBRANCH
$ git rm -rf .
--orphan
creates a new branch, but it starts without any commit. After running the above command you are on a new branch "NEWBRANCH", and the first commit you create from this state will start a new history without any ancestry.
You can then start adding files and commit them and they will live in their own branch. If you take a look at the log, you will see that it is isolated from the original log.
Legend! Thank you.
I created a branch
initial
before creatingmaster
. I wanted to squash merge a single commit into master but couldn't create a PR and if I created a branch it would have just contained all of the commits I wanted to squash. I resolved this with:Then updated the Default Branch to master in Settings -> Branches.