Blog
1021 posts on clinical medicine, epidemiology, research methodology, statistics and code — in English and Thai. Filter by category and language, or search.

Git Merge, Rebase & Squash — ตอนที่ 6: Workflow ของทีม และตารางตัดสินใจ
ตอนจบ: สามวิธี merge PR บน GitHub, cherry-pick, reset กับ rebase กับ revert, การ revert merge commit ด้วย -m 1, git pull ทำอะไรจริง ๆ, workflow feature branch หกขั้นที่ปลอดภัย, ตารางตัดสินใจเดียวจบ, policy ทีมเล็กและทีมที่ต้องเก็บประวัติละเอียด และการกู้คืนด้วย git reflog

Git Merge, Rebase & Squash — Part 6: Team Workflows and the Decision Guide
The finale: GitHub's three PR merge methods, cherry-pick, reset vs rebase vs revert, reverting a merge commit with -m 1, what git pull really does, a safe six-step feature-branch workflow, a single decision table, small-team and detailed-history policies, and recovery with git reflog.

Git Merge, Rebase & Squash — ตอนที่ 5: Conflict, ours/theirs และ Merge Strategies
Conflict ตอน merge และ rebase ปรากฏอย่างไร แก้และยกเลิกอย่างไร ทำไม ours/theirs ถึงกลับด้านตอน rebase และ merge strategies ของ Git ทำอะไรบ้าง — ort, octopus, -s ours เทียบกับ -X ours/-X theirs และ subtree

Git Merge, Rebase & Squash — Part 5: Conflicts, ours/theirs, and Merge Strategies
How conflicts appear during merge and rebase and how to resolve or abort them, why ours/theirs reverse under rebase, and what Git's merge strategies actually do — ort, octopus, -s ours versus -X ours/-X theirs, and subtree.

Git Merge, Rebase & Squash — ตอนที่ 4: Interactive Rebase และ Rebase ขั้นสูง
เจาะลึก interactive rebase — pick, reword, edit, squash, fixup, drop และการสลับลำดับ commit — พร้อม autosquash, rebase --onto, --rebase-merges และแพตเทิร์น rebase + fast-forward กับ rebase + squash สำหรับจัด feature branch ให้สะอาด

Git Merge, Rebase & Squash — Part 4: Interactive Rebase and Advanced Rebase
Master interactive rebase — pick, reword, edit, squash, fixup, drop, and reordering — plus autosquash, rebase --onto, --rebase-merges, and the rebase + fast-forward and rebase + squash patterns for a clean feature branch.

Git Merge, Rebase & Squash — ตอนที่ 3: Rebase — เขียนประวัติใหม่อย่างปลอดภัย
Rebase นำ commit ของ branch ไปสร้างใหม่บนฐานใหม่ ได้ประวัติแบบเส้นตรงที่สะอาด แลกกับการที่ commit hash เปลี่ยน บทนี้อธิบายว่าทำไม D กลายเป็น D′, rebase ต่างจาก merge อย่างไร, กฎห้าม rebase branch สาธารณะ และวิธี rebase feature branch ให้ทัน main ด้วย --force-with-lease

Git Merge, Rebase & Squash — Part 3: Rebase — Rewriting History Safely
Rebase replays your branch's commits onto a new base, giving a clean linear history — and rewriting commit hashes in the process. Learn why D becomes D′, how rebase differs from merge, the golden rule about never rebasing shared branches, and how to update a feature branch with --force-with-lease.

Git Merge, Rebase & Squash — ตอนที่ 2: Squash Merge — หนึ่งฟีเจอร์ หนึ่ง Commit
git merge --squash นำทั้ง feature branch ลงมาเป็น commit เดียวสะอาด ๆ ได้อย่างไร — Git บันทึกอะไร ทิ้งอะไรไปเงียบ ๆ ทำไม branch ยังดู "unmerged" ตาม ancestry, squash สองแบบที่ต้องแยกกัน และ squash merge ต่างจาก merge commit อย่างไร

Git Merge, Rebase & Squash — Part 2: Squash Merge — One Feature, One Commit
How git merge --squash lands a whole feature branch as one clean commit — what Git records, what it silently drops, why the branch still looks "unmerged" by ancestry, the two different kinds of squash, and how a squash merge differs from a merge commit.

Git Merge, Rebase & Squash — ตอนที่ 1: กราฟ Commit และ Merge ทุกรูปแบบ
Git ไม่ได้เก็บไฟล์เป็นเวอร์ชัน แต่เก็บเป็นกราฟของ commits ตอนที่ 1 ปูพื้น mental model นี้ แล้วพาไล่ดู Merge ทุกรูปแบบ ตั้งแต่ fast-forward, three-way ไปจนถึงแฟล็ก --no-ff และ --ff-only ที่กำหนดว่าจะเกิด merge commit หรือไม่

Git Merge, Rebase & Squash — Part 1: The Commit Graph and Every Kind of Merge
Git doesn't store file versions — it stores a graph of commits. Part 1 builds that mental model, then walks through every kind of merge: fast-forward, three-way, and the --no-ff and --ff-only flags that decide whether a merge commit appears.