社交链接
发布时间: 2022-05-19T16:00:37+08:00
原文链接:https://blog.csdn.net/yc1022/article/details/56487680
1.Checkout
git checkout –orphan latest_branch
-
Add all the files
git add -A
-
Commit the changes
git commit -am “commit message”
-
Delete the branch
git branch -D master
5.Rename the current branch to master
git branch -m master
6.Finally, force update your repository
git push -f origin master
————————————————
版权声明:本文为CSDN博主「yanchengyc」的原创文章,遵循CC 4.0 BY-SA版权协议
方便直接使用:
git checkout --orphan latest_branch
git add -A
git commit -am "重置仓库到最新一次commit"
git branch -D master
git branch -m master
git push -f origin master
注意:Gitee上还需要进行储存库GC来清理占用空间