I want to change a word in commit HEAD^2, how to do it?
EDIT
These commits have not been pushed yet. So it doesn't shown as pick xxxxxx in the interactive editor.
|
I want to change a word in commit HEAD^2, how to do it? EDIT
These commits have not been pushed yet. So it doesn't shown as |
||||
Vim will open and you will see something like this;
You should see something like this;
Press "Esc" to enter command mode. Type ":wq" to write, quit. Hit enter. Git will now reapply your commits up to that point. Then you're free to "edit previous commit" as you would normally:
or
Interactive rebase also allows you to re-order and remove commits of your choice. You should be aware that re-writing history like this will affect those who have pulled from you. See Recovering from upstream rebase. |
|||||
|
git rebase -i origin, here origin refers to origin/master. – Xiè Jìléi Jan 5 '11 at 23:39