修改历史上的 commit message

修改历史上的 commit message

  • 要修改的 commit hash code 假设为 A
  • git rebase -i A~1
  • 会出现一个编辑界面,在需要修改的 commit 的 hash 前面把 pick 改为 edit
  • git commit --amend 修改 message
  • git rebase --continue
  • git push -f