brewly — Ch.6 · Rebase onto main
Exercise 1 of 8
Before you start
Replaying commits
A merge joins two lines of history. A rebase instead takes your commits and replays them one by one on top of another branch, as if you had started there. The history stays a straight line.
The replayed commits are new commits with new ids. Rebase your own unshared work freely; never rebase commits others are building on.
Afterwards main can simply move forward to your branch.
- git log --oneline --graph --all
- see how the branches relate
- git rebase <branch>
- replay your commits on top of that branch
- git switch main
- go to main
- git merge <branch>
- fast-forward main to your work
You can reopen this any time with “Lesson”.
# BrewlyOrder coffee ahead.## Team- Maya (lead)- Alex (frontend)
Graph
- b7d58f2 Sharpen the sloganmain
- 24795b5 Offer a smaller tipHEAD → feature/tips
- 6ad9cbd Suggest tip amounts
- 1354d06 Add menu pageorigin/main
- 619eb3b Style the order button
- 5fc44ac Initial commit