Merging and conflicts
Combine finished work and resolve the overlapping lines calmly.
What you will be able to do
- Distinguish fast-forward and merge commits
- Read conflict markers
- Finish or abort a merge
A merge joins two histories. Git can combine most changes automatically; when both sides edit the same lines, you resolve the overlap by hand.
git switch main
git pull
git merge feature/pricing
# resolve the marked files
git add pricing.md
git commit
git merge --abort<<<<<<< HEAD
price = base * 1.15
=======
price = base * 1.25
>>>>>>> feature/pricing| Marker | Meaning |
|---|---|
| <<<<<<< HEAD | Start of your current branch version |
| ======= | Divide between the two versions |
| >>>>>>> branch | End of the incoming version |
Your turn
EasyFinish a merge safely
After resolving pricing.md, which commands complete the merge?
BASH · starter
# your commands hereCheck your understanding before moving on.
Knowledge checkQuestion 1
What happens in a fast-forward merge?
Select an answer to continue
Study tools
Make it yours.
Keep a private note for this lesson, then turn the key ideas into flashcards you can revisit.
Sign in to save notes and flashcards.Both are private to your account and stay with your progress.
Sign inFinished reading?
Lock in what you just learned.
0%
Mark this lesson complete to save your place and move one step closer to the certificate.