Git merge master into feature branch

后端 未结 11 713
既然无缘
既然无缘 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:29

    git merge

    you can follow below steps

    1. merge origin/master branch to feature branch

    # step1: change branch to master, and pull to update all commits
    $ git checkout master
    $ git pull
    
    # step2: change branch to target, and pull to update commits
    $ git checkout feature
    $ git pull
    
    # step3: merge master to feature(⚠️ current is feature branch)
    $ git merge master
    
    

    2. merge feature branch to origin/master branch

    origin/master is the remote master branch, while master is the local master branch

    $ git checkout master
    $ git pull origin/master
    
    $ git merge feature
    $ git push origin/master
    
    

提交回复
热议问题