第一步,
如果你有类似A—>B—>C—>D的提交记录(ABCD在这里代表commit id),对你来说C的提交信息是错误的
git rebase -i -p B
第二步,
找到错误的commit id 并把“pick” 改成“edit” (注:s为压缩及合并几个提交)按’Esc’退出编辑,按:wq
保存退出
第三步
修改 commit message
git commit --amend -m “填写你要修改的信息”
修改 commit author
git commit --amend --author=“xxx xxx@xxxx.com” --no-edit
第四步
git rebase --continue
第五步
git push --force