20220705 git creates an empty branch in the current warehouse

Order

// create empty branch
git checkout --orphan emptybranch

// remove those files that have already added before. 
git rm -rf .

// add new files
git add newfiles

// commit & push
git commit -m "new branch"
git push origin emptybranch

Effect

insert image description here

orphan parameter

insert image description here

reference

https://git-scm.com/docs/git-checkout
https://juejin.cn/post/6844904056436031496

Guess you like

Origin blog.csdn.net/Vissence/article/details/125617742
Recommended