Git: Merge a Commit into a different Branch

前端 未结 2 2017
小鲜肉
小鲜肉 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:11

    You need to cherry-pick those commits.

    Switch to the branch where you want to add the commits:

    git checkout develop
    

    Then, cherry-pick the commit. First do a git reflog and get the SHA-1 of the commit of the hotfix.

    Then, while you are on the branch develop, cherry-pick it

    git cherry-pick 
    

    Perform similar actions on the other branch version_1.

提交回复
热议问题