How to create a new (and empty!) “root” branch?

前端 未结 4 1839
生来不讨喜
生来不讨喜 2020-12-22 16:29

I would like to define a new \"root\" branch in this git repository. By \"root\" branch I mean a branch that is entirely independent of all the other branches in the reposi

4条回答
  •  伪装坚强ぢ
    2020-12-22 17:03

    If you use git 2.23 or above you may be used to git switch and git restore instead of git checkout. If so, the flag is the same as mentioned in this answer.

    git switch --orphan YourBranchHere
    

提交回复
热议问题