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...
Related
git checkout -b <branchname>
git checkout -b <branchname1> <remote>/<branchname2>
git checkout <branchname>
git checkout -
git checkout --<pathname>
git checkout HEAD <pathname>
git checkout --ours <pathname>
git checkout --theirs <pathname>
git checkout -m <branchname>
git checkout -b <branchname> <commit>
git checkout -t <remote>/<branchname>