Git merge two local branches

前端 未结 6 946
小鲜肉
小鲜肉 2021-01-29 19:18

I have branch Master, branchA and branchB. Now I\'m working in the branchA and I need to merge branchA with

6条回答
  •  花落未央
    2021-01-29 19:59

    The answer from the Abiraman was absolutely correct. However, for newbies to git, they might forget to pull the repository. Whenever you want to do a merge from branchB into branchA. First checkout and take pull from branchB (Make sure that, your branch is updated with remote branch)

    git checkout branchB
    
    git pull
    

    Now you local branchB is updated with remote branchB Now you can checkout to branchA

    git checkout branchA
    

    Now you are in branchA, then you can merge with branchB using following command

    git merge branchB
    

提交回复
热议问题