删除github上面的历史提交记录
如果不小心提交github提交错了,而 --amend 也不能修改提交者的信息,可以通过尝试下面的方式 Checkout bash 1 git checkout --orphan <latest_branch> Add all the files bash 1 git add -A Commit the changes bash 1 git commit -am "commit message" Delete the branch bash 1 git branch -D main Rename the current branch to main bash 1 git branch -m main Finally, force update your repository bash 1 git push -f origin main 缺点是:所有该分支的提交记录都将被删除 Reference how to delete all commit history in github?...