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.
This lesson needs a conflict to resolve, so this block builds one: a hello-git repository in this lesson's folder where main and a feature-login branch each added a different sentence at the same spot in README.md. Press Play to create it (pressing it again starts over) ...
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
Read this lesson in your language
All lessons in this course
13 lessons- 1Init and Your First Commit25 min
- 2Status, Diff, and Log25 min
- 3Branches and Merging30 min
- 4Resolving Merge Conflicts30 min
- 5Remotes: Push, Pull, Fetch30 min
- 6Stash and Cherry-pick25 min
- 7Rebasing30 min
- 8Interactive Rebase and Squashing30 min
- 9Tags and Releases20 min
- 10Branching Workflows20 min
- 11Recovering Lost Work25 min
- 12Hooks25 min
- 13Capstone: A Full Pull Request Flow40 min
