我的提交历史如下:
* 8cd26ba 2013-06-26 | history server-side (HEAD, noXHR)
* bffd858 2013-06-25 | popups and modals
* d95c5f4 2013-06-21 | Map update for new interaction
...
当我已经提交 '8cd26ba' 时,我发现了模态机制中的一个错误并想要修复它。我试图修改'bffd858'(因为修复与它相关),因为它描述了here。我已经执行了以下步骤:
打字
$ git rebase -i bffd858
git 向我展示(在 nano 中)
pick 6fa566b history server-side # Rebase bffd858..6fa566b onto bffd858 # # Commands: # 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 # # If you remove a line here THAT COMMIT WILL BE LOST. # However, if you remove everything, the rebase will be aborted. #
我已将 'pick' 替换为 'edit'
git对我说:
Stopped at 8cd26ba... history server-side You can amend the commit now, with git commit --amend Once you are satisfied with your changes, run git rebase --continue
我已经应用了我的错误修复并输入了
$ git commit -a --amend
打字
git rebase --continue
然后我在'8cd26ba'(最后一次提交)中找到了我的错误修复!
我做错了什么?