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
orphan parameter
reference
https://git-scm.com/docs/git-checkout
https://juejin.cn/post/6844904056436031496