【问题标题】:How to pick a commit in sub-branch and merge it into main branch?如何在子分支中选择一个提交并将其合并到主分支中?
【发布时间】:2012-12-05 03:16:34
【问题描述】:

所以我有:

master
+commit1
+commit2
+commit3

myBranch
+commitA
+commitB
+commitC

我想在 myBranch 中选择 commitB 并合并到 master 分支,我该怎么办?

【问题讨论】:

    标签: git merge branch commit git-cherry-pick


    【解决方案1】:
    git checkout master
    git cherry-pick commitB
    

    或者更好,git help cherry-pick 并阅读它。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-08-14
      • 2018-03-12
      • 2011-09-16
      • 2016-03-23
      • 2022-01-24
      • 1970-01-01
      相关资源
      最近更新 更多