Resolving Merge Conflicts
Part of the Git course
The first time Git refuses to finish a merge, it can feel like something broke. Nothing broke. A merge conflict happens when two branches changed the same lines of the same file in different ways, and Git genuinely cannot guess which version you want to keep.
You are on main. Somewhere along the way, a second branch also edited the same line of the same file that you edited on main. When you try to merge that branch in, Git compares both versions line by line and tries to combine them automatically. For every line only one side touched, that works fine.
Want to learn Git Resolving Merge Conflicts in a real environment?
Click below, get a fresh Linux box with Git ready to go, and work through Resolving Merge Conflicts hands-on with an AI tutor that knows your code.
Start this lessonResolving Merge ConflictsWhat you'll learn
- Merge conflict markers
- Manual resolution
- Git add after resolving
- Git merge --abort
- Mergetool
