Pro lesson All levels
Merge conflicts without panic
When two people change the same lines, git stops and asks you. Read a conflict, settle it, and finish the merge.
12 min8 hands-on steps
In this lesson you will
- Understand why a conflict happens and that nothing is lost
- Read conflict markers and decide what the file should say
- Resolve in an editor or by taking one side, then finish the merge
Words you'll meet
- Merge conflict
- Two branches changed the same lines differently, so git asks you to choose.
- Conflict markers
- The <<<<<<<, ======= and >>>>>>> lines git writes around the two versions.
- Resolve
- Edit the file to what it should say, then git add it.
The steps
Each step teaches one idea, then has you try it hands-on in your browser, and checks your work.
- 1When git can't decide
- 2The escape hatch
- 3Read the markers
- 4Which version wins?
- 5Resolve it
- 6Take a whole side
- 7Finish the merge
- 8Challenge
This lesson is part of LearnDE Pro
$12 a month or $100 a year: every lesson, spaced-repetition flashcards, and Learn by teaching. Refund on request within 14 days.