Merge conflict เกิดขึ้นเมื่อ Git ไม่สามารถรวมการเปลี่ยนแปลงโดยอัตโนมัติได้ (ทั้งสองฝั่งแก้ไขบรรทัดเดียวกัน) การแก้ไขเกี่ยวข้องกับการเข้าใจ conflict marker, การตัดสินใจเลือกผลลัพธ์ที่ถูกต้อง และการทำ merge ให้เสร็จสมบูรณ์ การทำได้อย่างมั่นใจเป็นทักษะเชิงปฏิบัติที่สำคัญ
เมื่อใดและทำไม conflict จึงเกิดขึ้น
Git auto-merges most changes, but a CONFLICT occurs when both branches changed the
SAME LINES (or one deleted what the other modified) — Git can't decide, so it asks YOU.
→ Conflicts are NORMAL in collaboration, not errors — just changes Git can't auto-resolve.
เข้าใจ conflict marker
<<<<<<< HEAD
code from YOUR current branch (the one you're merging INTO)
=======
code from the OTHER branch (the one being merged IN)
>>>>>>> feature-branch
