Git: create a new empty branch with no history or commits
If you need to create a new git branch for your project, one that is completely fresh and with no previous history or commits, that can be done using the “orphan” flag of the switch command if you are using git 2.23+. Fresh branch using ‘git switch’ # create fresh branch git switch –orphan my-fresh-branch … Git: create a new empty branch with no history or commits