edit e0871dfb91f6a0acc5298d9e1960291629479a46 fix: fucking the code pick 0a4549598e56b53395c562e784553d863ec597c1 fix: 正常的提交信息1
# ...
三、修改 commit 的具体信息
执行 git commit --amend,会得到下面的内容:
1 2 3 4 5 6
fix: fucking the code
# Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # # Date: Fri Jun 16 12:20:08 2023 +0800
修改文本内容:
1 2 3 4 5 6
fix: fucking me
# Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # # Date: Fri Jun 16 12:20:08 2023 +0800
保存并继续下一条git rebase --continue,直到全部完成。接着执行 git push -f 推到远端,当然这需要有 Maintainer 权限。
# Rebase 29fc076c..db0768e3 onto 29fc076c (3 commands) # # Commands: # p, pick <commit> = use commit # r, reword <commit> = use commit, but edit the commit message # e, edit <commit> = use commit, but stop for amending # s, squash <commit> = use commit, but meld into previous commit # f, fixup <commit> = like "squash", but discard this commit's log message # x, exec <command> = run command (the rest of the line) using shell # b, break = stop here (continue rebase later with 'git rebase --continue') # d, drop <commit> = remove commit # l, label <label> = label current HEAD with a name # t, reset <label> = reset HEAD to a label # m, merge [-C <commit> | -c <commit>] <label> [# <oneline>] # . create a merge commit using the original merge commit's # . message (or the oneline, if no original merge commit was # . specified). Use -c <commit> to reword the commit message. # # These lines can be re-ordered; they are executed from top to bottom. # # If you remove a line here THAT COMMIT WILL BE LOST. # # However, if you remove everything, the rebase will be aborted. # # Note that empty commits are commented out