GtGit · Lesson 4 of 8
Merge Conflicts
Two branches edit the same line, then merge. Git can't guess which version you want — so it asks. Conflicts look scary; they're actually a simple text-editing chore.
When git can't auto-merge, it stops and marks the conflicting region in the file with conflict markers. Your job: open the file, pick (or combine) the versions, delete the markers, stage, commit. That's the whole procedure.
✦ Tip
VS Code and most editors show conflicts with 'Accept Current / Accept Incoming / Accept Both' buttons — same edit, less typing. Small, frequent merges mean small, rare conflicts.
VS Code and most editors show conflicts with 'Accept Current / Accept Incoming / Accept Both' buttons — same edit, less typing. Small, frequent merges mean small, rare conflicts.