lovelmh13/myBlog

git rebase 操作

Opened this issue · 0 comments

image
  1. git rebase -i 到想统一的 commit 那里

  2. 把除了最上面的 pack 以外都改成 s

image
  1. 把不需要的 commit 注释掉

  2. 成功了的话,就 git push -f(!!一定要 -f)

  3. 第二步错了的话,需要再放弃掉刚才的操作(git rebase —abort)