$ git rebase -i HEAD~n
This will prompt a vi
console with options.
The n
parameter indicates the commit quantity to edit in {creation time} ascending order.
Say you run $ git rebase -i HEAD~2
; this will select the last two commits.
After this you will want to type i
to enter insert mode in vi
console and ESC
to exit insert mode.
Find the commit to edit its message and replace pick
for r
(option description will be displayed in console).
Press :
and write wq
(write & quit) to save changes.
Edit your commit message, save changes and exit :wq
.
Push changes $ git push -f
.