interactive rebase

A rebase that first opens a todo list in your editor, letting you reorder, reword, squash or drop commits before they are replayed.

In more detail

git rebase -i HEAD~3 lists the last three commits oldest first. You change the word in front of each line, save and close, and Git replays them your way, pausing when it needs a new message or hits a conflict. Use it to tidy local work before sharing, never on commits others have.

Example

git rebase -i HEAD~3

Related terms

Taught in

References