Modify historical commit information
Operation steps:
- git rebase -i lists the commit list
- Find the commit record that needs to be modified, change pick to edit or e, :wq save and exit
- Modify the specific information of the commit git commit --amend, save and continue to the next git 4. 4. rebase --continue until all is completed
- You can also skip or exit git rebase in the middle (–skip | --abort)
# 列出 rebase 的 commit 列表,不包含 <commit id>
$ git rebase -i <commit id>
# 最近 3 条
$ git rebase -i HEAD~3
# 本地仓库没 push 到远程仓库的 commit 信息
$ git rebase -i
# vi 下,找到需要修改的 commit 记录,```pick```修改为 ```edit```或 ```e```,```:wq```保存退出
# 重复执行如下命令直到完成
$ git commit --amend --only -m "modify message by daodaotest"
$ git rebase --continue
# 中间也可跳过或退出 rebase 模式
$ git rebase --skip
$ git rebase --abort
https://cloud.tencent.com/developer/article/1730774