Git ขั้นสูง
Amanda Crawford-Adamo
Software and Data Engineer

คำสั่ง Git Merge:
git merge

Fast forward merge คืออะไร?
$$
เมื่อไม่ควรใช้

Fast Forward แบบค่าเริ่มต้น
git checkout main
git merge feature_branch
บังคับให้ Fast Forward
git merge <branch> --ff-only
ตัวอย่าง
git checkout main
git merge feature_branch --ff-only

Recursive merge คืออะไร?
$$
เมื่อไม่ควรใช้

คำสั่ง Recursive Merge:
git merge --no-ff <branch>
ตัวอย่าง
$ git checkout main
Switched to branch 'main'
Your branch is up to date with 'origin/main'.
$ git merge --no-ff feature_branch
Merge made by the 'recursive' strategy.
...

คำสั่ง Fast Forward Merge
git merge <branch_name> # default command
git merge --ff-only <branch_name> # force fast forward merge
คำสั่ง Recursive Merge
git merge --no-ff <branch_name>
Git ขั้นสูง