Git: merge only the changes made on the branch

后端 未结 4 1320
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-07 00:38
  G---H             // Release Branch
 /
/
A---B---E---F---    // master
    \\
     \\
      C---D---     // bug fix branch

Based on our particular ne

4条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-07 01:40

    Note: as explained above, cherry-picking is acceptable here.
    Its main drawbacks are:

    • in case of merge, you would get conflict because of duplicate commits
      See "Git cherry pick and datamodel integrity"
    • ignore functional dependencies.
      See "How to merge a specific commit in git".

    In your case:

    • no need to merge back.
    • if you are sure C and D aren't based on code introduced in B, ... cherry-pick them wherever you need them.

提交回复
热议问题