brewly — Ch.5 · Clean up after a squash merge
Exercise 6 of 6
Before you start
A squash merge makes a new commit
Squashing puts one new commit on main. Your original commits are never merged, only their changes.
This team’s server deletes the branch after merging. git fetch --prune removes your outdated origin/… name for it.
git branch -d then refuses to delete your local branch, because its commits are not on main. You know the work arrived, so -D deletes it anyway. Be sure before you use it.
- git switch main
- leave the finished branch
- git pull
- get the squashed commit
- git fetch --prune
- forget branches deleted on the server
- git branch -d <name>
- delete, only if merged
- git branch -D <name>
- delete even if git sees it as unmerged
You can reopen this any time with “Lesson”.
# BrewlyOrder coffee ahead.## Team- Maya (lead)- Alex (frontend)
Graph
- 3eadd52 Fix typoHEAD → feature/receiptsorigin/feature/receipts
- cf91067 Print receipts
- 1354d06 Add menu pageorigin/mainmain
- 619eb3b Style the order button
- 5fc44ac Initial commit