Git: Merge a Commit into a different Branch

前端 未结 2 2020
小鲜肉
小鲜肉 2020-12-02 01:36

So I have 3 branches;

  • develop - my continued development branch
  • version_1 - a release branch
  • version_2
2条回答
  •  北荒
    北荒 (楼主)
    2020-12-02 02:02

    Merging only one or a few commits mean using git cherry-pick

    First cancel the merge you just did: see "Undo a Git merge?".
    Then:

    git checkout version_1
    git cherry-pick 
    

    That can apply to multiple commits or a range of commits: see "How to cherry pick a range of commits and merge into another branch".

提交回复
热议问题