When both branches changed the same lines, git can't know which version you want. It stops with a conflict and asks you. A conflict doesn't mean anything broke. It's a question.
git merge feature/late
Auto-merging README.md
CONFLICT (content): Merge conflict in README.md
Automatic merge failed; fix conflicts and then commit the result.
git status
On branch main
You have unmerged paths.
(fix conflicts and run "git commit")
(use "git merge --abort" to abort the merge)
Unmerged paths:
(use "git add <file>..." to mark resolution)
both modified: README.md ← changed on both branches
no changes added to commit (use "git add" and/or "git commit -a")Git writes both versions into the file, between conflict markers:
cat README.md
# Monster Market
<<<<<<< HEAD
Open 8 to 5. ← your side: the branch you're on
=======
Open 9 to 9. ← their side: the branch you're merging in
>>>>>>> feature/lateLines outside the markers merged cleanly. The merge waits until you settle every conflict; the next lesson does that.
Objectives
- Merge the summer sale into
main, and hit the conflict. - Read the price
mainwants. - Read the price the sale wants.