brewly — Ch.6 · Choose how to merge
Exercise 7 of 8
Before you start
Three ways in
Fast-forward: main just moves up. --ff-only allows nothing else and fails if a merge would be needed.
Merge commit: --no-ff records one even when main could just move, so the branch stays visible.
Squash: --squash stages all the branch’s changes at once without recording a merge. You commit them yourself as one commit. The branch is then not "merged", so deleting it needs -D.
- git merge --ff-only <branch>
- only move forward
- git merge --no-ff <branch>
- always make a merge commit
- git merge --squash <branch>
- stage the changes as one
- git commit -m "What you did"
- commit the squashed changes
- git branch -D <name>
- delete a branch git sees as unmerged
You can reopen this any time with “Lesson”.
# BrewlyOrder coffee ahead.## Team- Maya (lead)- Alex (frontend)
Graph
- e1a6cd7 wip againfeature/tip-jar
- 00acff8 wip
- d5dea08 Try a tip jar
- 5794e08 Add daily specialfeature/specials
- 1354d06 Add menu pageHEAD → mainorigin/main
- 619eb3b Style the order button
- 5fc44ac Initial commit