gpt4 book ai didi

git merge --no-commit 与 git cherry-pick --no-commit

转载 作者:IT王子 更新时间:2023-10-29 00:57:12 28 4
gpt4 key购买 nike

git merge --no-commitgit cherry-pick --no-commit 有区别吗?

如果我在这两个命令之后提交,历史记录会有什么不同吗?

最佳答案

如果你在 git merge --no-commit 之后提交,你实际上会得到一个 merge 提交。而在 git cherry-pick --no-commit 之后,您将获得单亲提交。

因此,是的,这两个命令之间存在差异。

特别是如果你有类似的东西

A -- B -- C
\ L HEAD
\
-- D -- E

如果您cherry-pick 提交E,您将不会得到提交D 的修改。而如果您 merge ,则两者都会得到。

关于git merge --no-commit 与 git cherry-pick --no-commit,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20837080/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com