http://git-scm.com/book/en/Git-Branching-Rebasing
但对于已经被推送的提交记录无效。我该如何压缩最近的几个提交记录,包括本地和远程仓库?当我运行git rebase -i origin/master~4 master
命令时,在编辑器中将第一个设置为 pick
,将其它三个设置为 squash
,然后退出(在emacs中通过c-x c-c),我得到了:$ git rebase -i origin/master~4 master
# Not currently on any branch.
nothing to commit (working directory clean)
Could not apply 2f40e2c... Revert "issue 4427: bpf device permission change option added"
$ git rebase -i origin/master~4 master
Interactive rebase already started
这里的2f40是pick
提交。现在4个提交记录都没有出现在git log
中。我原本期望编辑器会被重新启动以便我能输入提交信息。我做错了什么?