<img width="1357" alt="image" src="https://github.com/lovelmh13/myBlog/assets/27727987/c6a87095-7b67-4660-8264-0cb86785b279"> 1. git rebase -i 到想统一的 commit 那里 2. 把除了最上面的 pack 以外都改成 s <img width="1383" alt="image" src="https://github.com/lovelmh13/myBlog/assets/27727987/34fbe4b2-16a4-41a8-8d3c-19624e64e195"> 3. 把不需要的 commit 注释掉 4. 成功了的话,就 git push -f(!!一定要 -f) 5. 第二步错了的话,需要再放弃掉刚才的操作(git rebase —abort)