Stage 2 · Lesson 6 of 9
Merge conflicts
A happens when two branches change the same lines and cannot decide which version to keep. Git marks the clash inside the file with <<<<<<<, ======= and >>>>>>> lines, showing both versions. You edit the file into the correct combined version and delete the markers.
Then you run git add and commit to finish the merge. Conflicts are normal, not a sign you broke something, and you meet them as soon as two people share a . To keep them small, keep branches short-lived and bring the latest main into them often.
Common trapdeleting the other person's changes to make the conflict go away, so read both sides before choosing.
A question to check yourself, an AI practice session and 1 cheat sheet entry come with the full roadmap. Unlock
Resources for this stage
Start with· follow one of these
- GitHub repoFreeGitHub Skills: Introduction to GitHub
GitHub · Beginner
Free hands-on exercise: branch, commit, open and merge a pull request in about an hour
- CourseFreeThe Missing Semester of Your CS Education
MIT · Beginner
MIT lectures on the tools degrees skip; the shell and version control lectures are enough here
Practise
Keep handy
Also worth your time
How to choose, structure and present projects so a reviewer sees your best work first