我尝试使用git的交互式rebase重新编写开发分支中的提交。这是我在我的分支中提交的列表:
git rebase -i HEAD~6
pick e7c0cd9 Create VERSION file and set to 1.0.0
pick 26700a6 Modify shortcode for columns
pick dfa535a Increase greybox h3 bottom margin to 30px
pick 47f11bc Increase margin and padding for greybox-item
pick 98c2e3a Create style for lt-greybox
pick d4840be Create style for .image class to provide spacing
所以我所做的就是将e7c0cd9移到列表的底部,从而使其成为最新的提交:
pick 26700a6 Modify shortcode for columns
pick dfa535a Increase greybox h3 bottom margin to 30px
pick 47f11bc Increase margin and padding for greybox-item
pick 98c2e3a Create style for lt-greybox
pick d4840be Create style for .image class to provide spacing
pick e7c0cd9 Create VERSION file and set to 1.0.0
rebase在没有任何合并错误的情况下发生,因为进度指示器循环执行它的变基,但是当它完成时它不应用任何先前的提交,它只应用e7c0cd9而不是5在它之前。
为什么会发生这种情况会有任何原因 - 我搜索了Google,但无法找到任何合理的解释?
在rebase之后输出git reflog:
输出git reflog(我希望这能正确输出格式):
e7c0cd9 HEAD@{0}: rebase -i (pick): updating HEAD
1d225f9 HEAD@{1}: rebase -i (pick): Create style for .image class to provide spacing
52e9fc0 HEAD@{2}: rebase -i (pick): Create style for lt-greybox
5febbc8 HEAD@{3}: rebase -i (pick): Increase margin and padding for greybox-item
61709a0 HEAD@{4}: rebase -i (pick): Increase greybox h3 bottom margin to 30px
b87b0b3 HEAD@{5}: rebase -i (pick): Modify shortcode for columns
8e325f3 HEAD@{6}: rebase -i (start): checkout HEAD~6
在Mac OSX 10.10.2上使用Git v2.0.1