Deconstructing Merge Conflicts
When two branches modify the same line in a file, Git pauses the merge and inserts conflict markers:
<<<<<<< HEAD (Current change on main)
$databaseHost = '127.0.0.1';
=======
$databaseHost = 'db.production.internal';
>>>>>>> feature/cloud-migration (Incoming change)
How to Resolve:
- Open the file and keep the intended code.
- Delete all markers (
<<<<<<<,=======,>>>>>>>). - Stage and commit:
git add . && git commit -m "fix: resolve database host conflict".