gpt4 book ai didi

git - 如何在 Git 中将一个分支的特定提交 merge 到另一个分支?

转载 作者:IT王子 更新时间:2023-10-29 01:18:17 26 4
gpt4 key购买 nike

我有 BranchA,它比 BranchB 提前 113 次提交。

但我只想将 BranchA 的最后 10 次左右的提交 merge 到 BranchB 中。

有办法吗?

最佳答案

git cherry-pick <commit>命令允许您进行一次提交(来自任何分支),并且实质上是在您的工作分支中将其 rebase 。

Chapter 5 of the Pro Git book explains it better than I can ,配有图表等。 (The chapter on Rebasing 也是不错的读物。)

最后,还有一些good comments on the cherry-picking vs merging vs rebasing in another SO question .

关于git - 如何在 Git 中将一个分支的特定提交 merge 到另一个分支?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6372044/

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