Merge Conflicts
Objective
Resolve merge conflicts confidently in various scenarios.
Tools & Technologies
gitVS Codemergetool
Key Commands
git merge feature-branchgit statusgit diffgit mergetoolgit merge --abortLab Steps
01
Create Conflict
Set up a deliberate merge conflict between two branches.
02
Understand Markers
Read and interpret <<<<<<<, =======, >>>>>>> conflict markers.
03
Resolve
Edit conflicted files to combine both changes correctly.
04
Rebase Conflicts
Resolve conflicts that occur during a rebase operation.
Challenges Encountered
- Accepting the wrong version during conflict resolution corrupts logic
- Rebase conflicts repeat for each commit being rebased
Key Takeaways
- git mergetool with VS Code or vimdiff makes conflicts visual
- Resolve conflicts by understanding the intent of both changes, not just the diff