git checkout --orphan <branchname>

Create a new orphan branch

This command creates a new orphan branch, also known as a root branch, in the git repository. An orphan branch is a branch that does not have any parent commits, allowing you to start a completely new history.

The <branchname> parameter specifies the name of the new branch. It is important to note that this command discards the commit history of the previous branch, so use it with caution.

Sign in to enable bookmarking, reminders, progress-tracking and more...