git modification history commit information

Modify historical commit information
Operation steps:

  1. git rebase -i lists the commit list
  2. Find the commit record that needs to be modified, change pick to edit or e, :wq save and exit
  3. 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
  4. 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

Guess you like

Origin blog.csdn.net/frighting_ing/article/details/132294862