ในกรณีของคุณหากต้องการเดินหน้าอย่างรวดเร็วให้ทำดังนี้
$ git merge --ff-only origin/master
วิธีนี้ใช้--ff-onlyตัวเลือกgit mergeเนื่องจากเป็นคำถามที่ถามถึง "การกรอไปข้างหน้า" โดยเฉพาะ
นี่คือข้อความที่ตัดตอนมาจากgit-merge(1)ที่แสดงตัวเลือกไปข้างหน้าอย่างรวดเร็วมากขึ้น:
--ff, --no-ff, --ff-only
Specifies how a merge is handled when the merged-in history is already a descendant of the current history. --ff is the default unless merging an annotated
(and possibly signed) tag that is not stored in its natural place in the refs/tags/ hierarchy, in which case --no-ff is assumed.
With --ff, when possible resolve the merge as a fast-forward (only update the branch pointer to match the merged branch; do not create a merge commit). When
not possible (when the merged-in history is not a descendant of the current history), create a merge commit.
With --no-ff, create a merge commit in all cases, even when the merge could instead be resolved as a fast-forward.
With --ff-only, resolve the merge as a fast-forward when possible. When not possible, refuse to merge and exit with a non-zero status.
ฉันกรอไปข้างหน้าบ่อยพอที่จะรับประกันนามแฝง:
$ git config --global alias.ff 'merge --ff-only @{upstream}'
ตอนนี้ฉันสามารถเรียกใช้เพื่อกรอไปข้างหน้า:
$ git ff
git checkout HEADไม่เคยทำอะไรเลยHEADหมายถึงการกระทำที่ได้ชำระเงินแล้ว