🔀 CHAPTER · GIT MERGE
Chef You

Combine Parallel
Recipes

Two chefs worked on different features at the same time. git merge brings their work together into one timeline — creating a merge commit that ties the branches.

Scene I

Two types of merge

Chef B

Fast-forward — if main has no new commits, it just slides forward to match the branch. No merge commit needed.

Three-way merge — if both branches have new commits, Git creates a merge commit that combines them. This is the spider-web you see in git log --graph.

🔀 MERGE VISUALIZER See two branches. Click merge to combine them.
main
feature
merge commit
Merged!

🎉 Branches united

The merge commit ties both branches together. All commits from the feature branch are now part of main's history.

Merge preserves history — every commit, every branch point, every parallel path is visible in the log graph.

$ git checkout main
$ git merge feature/glaze
Merge made by the 'ort' strategy.
3 files changed, 45 insertions(+)
Epilogue
Merge brings branches together.
History is preserved.
The merge commit ties the knot.
Fast-forward
Linear, no merge commit
When main has no new work
vs
Three-way
Merge commit created
When both branches diverge