标有squash(或 s)的提交将合并到主提交即。标有 pick 的那个。 现在,我们将在编辑器中保存更改并退出。在此之后,rebase -i 工具将打开另一个编辑器以输入提交消息,如下所示: # This is a combination of 4 commits. The first commit's message is: Delete .lock # This is the 2nd commit message: D...
pick f7f3f6d changed my name a bit squash 310154e updated README formatting and added blame squash a5f4a0d added cat-file 当保存并退出编辑器时,Git 应用所有的三次修改然后将你放到编辑器中来合并三次提交信息: # This is a combination of 3 commits. # The first commit's message is: change...
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...
10 # e, edit = use commit, but stop for amending 11 # s, squash = use commit, but meld into previous commit 12 # f, fixup = like "squash", but discard this commit's log message 13 # x, exec = run command (the rest of the line) using shell 14 # d, drop = remove commit...
squash a6e40b3 add 作者:王焕之 pick ddb6576 add 文章出处 然后保存并退出编辑器,啊哈,Git 似乎有点疑惑,它并不知道选择哪个 commit 信息作为合并的最终 commit 信息,于是 Git 打开了新的对话框,让我自己输入新的合并提交信息。 # This is a combination of 2 commits.# This is the 1st commit message:...
# f,fixup[-C|-c]<commit>=like"squash"but keep only the previous # commit's log message,unless-Cis used,inwhichcase# keep onlythiscommit's message;-c is sameas-Cbut # opens the editor # x,exec=runcommand(the restofthe line)using shell # b,break...
# 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 # # These lines can be re-ordered; they are executed from top to...
11 # s, squash <commit> = use commit, but meld into previous commit 12 # f, fixup <commit> = like "squash", but discard this commit's log message 13 # x, exec = run command (the rest of the line) using shell 14 # b,...
但是commit是不能删除的,只能压缩(squash)也就是,将多个commits合并成一个commit,这样提交记录就比较干净了。 用法 git rebase -icommit_hash^ NOTE:commit_hash^中的^用于指示是从该commit到HEAD 然后弹出编辑界面,如下。 pick9ca62a2commit_msg_xxxxxxxxpickda462a1commit_msg_yyyyyyyy...pickda462a1commit_msg...
这会产生一次交互式的rebase(interactive rebase), 只会列出没有推(push)的提交(commit), 在这个列表时进行reorder/fix/squash 都是安全的。 检查是否分支上的所有提交(commit)都合并(merge)过了 检查一个分支上的所有提交(commit)是否都已经合并(merge)到了其它分支, 你应该在这些分支的head(或任何 commits)之间...