brewly — Ch.6 · Rewrite your own history
Exercise 4 of 8
Before you start
The interactive rebase
git rebase -i <commit> opens a todo list of the commits after that one, oldest first. Git then does what the list says, from top to bottom.
Change the word at the start of a line: pick keeps a commit, reword lets you change its message. Moving a line moves the commit.
Save the list. For each reworded commit another editor opens with its message.
- git log --oneline
- see your commits
- git rebase -i main
- edit the commits that are not on main
- git rebase --abort
- return to how it was
You can reopen this any time with “Lesson”.
# BrewlyOrder coffee ahead. Collect stamps.## Team- Maya (lead)- Alex (frontend)
Graph
- e7357b4 Describe the stamp cardHEAD → feature/loyalty
- cdc0d9f stuff
- 4dfa059 Add the loyalty module
- 1354d06 Add menu pageorigin/mainmain
- 619eb3b Style the order button
- 5fc44ac Initial commit