Manual Merge Conflict Resolution
Learn to manually identify and resolve merge conflicts that arise when integrating divergent branches.
Understanding Merge Conflicts
Welcome to the world of merge conflicts! Don't worry, they're a normal part of collaborating with Git. A merge conflict happens when Git can't automatically figure out how to combine changes from two different branches.
This usually occurs when two branches modify the same lines in the same file in different ways, or when one branch deletes a file that another branch modified.
Why Conflicts Arise
Git is incredibly smart at merging most changes automatically. However, it needs human help when faced with ambiguity. Here are common scenarios:
- Same line, different changes: Two people edit the exact same line of code differently.
- One deletes, one modifies: One branch deletes a file, while another branch modifies it.
- Rename vs. Modify: A file is renamed in one branch and modified in another.
All lessons in this course
- Manual Merge Conflict Resolution
- Interactive Rebasing for History
- Cherry-picking Commits
- Using Git Rerere to Reuse Conflict Resolutions