指令含义:
● p, pick = use commit
● r, reword = use commit, but edit the commit message
● e, edit = use commit, but stop for amending
● s, squash = use commit, but meld into previous commit
● f, fixup = like “squash”, but discard this commit’s log message
● x, exec = run command (the rest of the line) using shell
● d, drop = remove commit
$ git log --oneline
291e427 update website
8c8f3f4 update website
1693a6f update clear-logs.sh version
3759b84 update clear-logs.sh
fc36a2a add links
1d795e6 fix && update clear-logs.sh 0.0.2
9536dab add dingtalk script
3a51aaa fix shellcheck problem
2db6ad3 add clear logs scripts
e57b0e6 fix && add batch del
17cb931 fix && add batch del
cf7e875 add redis script
fe4bbcb Initial commit
复制代码
编辑归并版本
指定要归并版本号,cf7e875 不加入归并,进入 vi 编辑器
[/code] [code]$ git rebase -i cf7e875
pick 17cb931 fix && add batch del
pick e57b0e6 fix && add batch del
pick 2db6ad3 add clear logs scripts
pick 3a51aaa fix shellcheck problem
pick 9536dab add dingtalk script
pick 1d795e6 fix && update clear-logs.sh 0.0.2
pick fc36a2a add links
pick 3759b84 update clear-logs.sh
pick 1693a6f update clear-logs.sh version
pick 8c8f3f4 update website
Rebase cf7e875..291e427 onto cf7e875 (10 commands)