2019-09-03发表2023-01-13更新程序员几秒读完 (大约49个字)Git清理历史提交记录123456789101112131415161718192021222324# 1. Checkout git checkout --orphan latest_branch# 2. Add all the files git add -A# 3. Commit the changes git commit -am "commit message"# 4. 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 masterGit清理历史提交记录http://www.mspring.org/2019/09/03/Git清理历史提交记录/作者雾非雾的情思发布于2019-09-03更新于2023-01-13许可协议#git