search

Home  >  Q&A  >  body text

The git branch is merged from B to A, but there are codes 1 and 2 in branch B. How to remove the code of 2 and only merge the code of 1 from B to A?

The code has B分支 and A分支
Now we need to merge B分支 onto A分支
B分支There is development 1 code for and development 2 code.
The submitted code history of development 1 and development 2: 1->2->1->1
The question is how to remove the code of development 2 and only merge the code of development 1 into the A branch?

Please give me some advice~~

phpcn_u1582phpcn_u15822820 days ago746

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