Skip to content

How to push new branch without history?

junwufan edited this page Aug 24, 2021 · 1 revision

Create a new orphan branch, named <new_branch>, started from <start_point> and switch to it. The first commit made on this new branch will have no parents and it will be the root of a new history totally disconnected from all the other branches and commits.

Create an Orphan Branch

git checkout --orphan orphan_name