Git merge master into feature branch

后端 未结 11 715
既然无缘
既然无缘 2020-11-27 08:56

Let’s say we have the following situation in Git:

  1. A created repository:

    mkdir GitTest2
    cd GitTest2
    git init
    
  2. Some m

11条回答
  •  忘掉有多难
    2020-11-27 09:22

    In Eclipse -
    

    1)Checkout master branch

    Git Repositories ->Click on your repository -> click on Local ->double click master branch
    ->Click on yes for check out
    

    2)Pull master branch

    Right click on project ->click on Team -> Click on Pull
    

    3)Checkout your feature branch(follow same steps mentioned in 1 point)

    4)Merge master into feature

    Git Repositories ->Click on your repository -> click on Local ->Right Click on your selected feature branch ->Click on merge ->Click on Local ->Click on Master ->Click on Merge.
    

    5)Now you will get all changes of Master branch in feature branch. Remove conflict if any.

    For conflict if any exists ,follow this -
    Changes mentioned as Head(<<<<<< HEAD) is your change, Changes mentioned in branch(>>>>>>> branch) is other person change, you can update file accordingly.
    

    Note - You need to do add to index for conflicts files

    6)commit and push your changes in feature branch.

    Right click on project ->click on Team -> Click on commit -> Commit and Push.
    

    OR

    Git Repositories ->Click on your repository -> click on Local ->Right Click on your selected feature branch ->Click on Push Branch ->Preview ->Push
    

提交回复
热议问题