when someone abandons you,it is him that gets loss because he lost someone who truly loves him but you just lost one who doesn’t love you.
先提交了一个 commit 信息,结果错了,想修改,想想之前也搞错了很多作者信息,大概这次可以把强迫症都修补下了。
整理下 git 修改 commit 信息的步骤:
首先回到想修改的 commit 信息的位置
1 | $ git log --oneline |
1 | $ git rebase -i --root |
1 | $ git commit --amend -m '新的 commit 信息' |
pick 改成 edit,保存退出pick 改成 reword,保存退出后跳转到 commit 信息编辑,编辑完保存,无需 3、4 步骤$ git commit --amend --author='* <*@*>' # --author='* <*@*>' 用来修改作者信息,注意用户名和邮件之间有个空格
1
2
3
4
4. 上述命令回车后进入修改 commit 信息,修改完保存后,输入下方命令将新的 commit 信息保存到 git 中
```bash
$ git rebase --continue
$ git push --force # 强制推送到远程仓库,推送前得确认其他人没有推送
be slow to promise and quick to perform.