search

Home  >  Q&A  >  body text

git分支从B合并到A但是在B分支有1和2的代码怎么去掉2的代码只合并1的代码从B到A上?

代码有 B分支A分支
现在要把B分支合并到A分支
B分支开发1的代码和开发2的代码。
开发1和开发2的提交代码历史:1->2->1->1
问题是怎么去掉开发2的代码只把开发1的代码合并到A分支上?

求大神指点~~

phpcn_u1582phpcn_u15822767 days ago716

reply all(3)I'll reply

  • PHPz

    PHPz2017-05-02 09:41:37

    It seems that you can only create a new branch from branch A? After development is completed, go directly to branch A instead of going through branch B and then to branch A

    reply
    0
  • 大家讲道理

    大家讲道理2017-05-02 09:41:37

    git rebase B A

    reply
    0
  • 天蓬老师

    天蓬老师2017-05-02 09:41:37

    Revert 2 commits on branch B, and then do a rebase and merge

    reply
    0
  • Cancelreply