Git Medium · Lesson 1 · On the house

Interactive rebase

Edit a local commit series. Lesson 1 is free — on the house.

Lessons · Git Medium · Lesson 1 of 10 · On the house

Interactive rebase

Edit a local commit series.

Illustration for Git
Lesson 1 is on the house.

git rebase -i HEAD~3 opens an todo list to pick, reword, squash, fixup, drop, or reorder.

Squash combines commits; reword edits messages; edit stops to amend mid-replay.

Use only on commits not yet shared — rewriting publishes pain.

Conflict mid-rebase: fix, add, rebase --continue (or --abort).

A clean interactive rebase is how feature branches become reviewable stories.

irebase

git rebase -i HEAD~3
Match this when you type.

Quiz

What does rebase -i let you do?

Quiz

squash in the todo list means?

Quiz

On conflict during rebase?

Quiz

Safe target for interactive rebase?

Check

Match the still for: Interactive rebase.

Open-book: the answers are on this page. Pass every quiz and check (5) to mark the lesson done. This visit: 0/5.