Worst case conflict: không phải thêm/xóa dòng đơn giản mà là structural refactor — function bị rename, logic được reorganize.
Quy trình an toàn:
1. Hiểu context trước khi resolve:
bash
git log --oneline main..feature/my-branch # commits của feature
git log --oneline feature/my-branch..main # commits của main
git diff $(git merge-base HEAD feature/my-branch) feature/my-branch -- src/file.ts2. Dùng 3-panel merge tool — git mergetool (trái: ours, phải: theirs, giữa: base — common ancestor, dưới: result). Không resolve bằng tay trong terminal với structural conflict.
3. Resolve và verify: git add src/file.ts, chạy test cho phần code đó TRƯỚC khi git merge --continue.
4. Sau merge: review lại diff của merge commit — git diff main~1..main -- src/file.ts.
Nguyên tắc: khi không chắc, chọn solution bảo toàn logic của cả 2 sides thay vì chọn 1 side. Đừng dùng -X ours hay -X theirs với structural conflicts.