从另一个分支应用补丁的*正确*方法是什么?



我在一个分支中做了一个修复,并想将它应用到另一个分支。以下是我一直在做的事情:

git diff 68610d^ 68610d | git apply
git commit -a -m "SV-656  IP blocking not working  (applying patch from 68610d)"

工作得很好,但在我看来,这似乎不是一个很像礼物的方式来做事情。特别是,我实际在做的事情只有从评论中才能看出来。这是一个非常基本的活动,我不认为git会错过它。

EDIT:这是"cherry-pick"的功能吗?

正确的方法是

git cherry-pick 68610d

如果你真的想修改提交消息:

git cherry-pick --no-commit 68610d
git commit -m "SV-656  IP blocking not working  (applying patch from 68610d)"