Git merge master into feature branch

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

    I am on the feature branch and made refactorings. I want to merge the master changes now to my feature branch. I am far behind. Note I do not want to pull the master changes to my local because my feature branch have modules moved from one place to another. I found just performing below without pull does not work. it says "Already up to date."

     //below does not get the latest from remote master to my local feature branch without git pull
        git checkout master 
        git fetch 
        git checkout my-feature-branch 
        git merge master
    

    This below works, note use git merge origin/master:

     git checkout master 
        git fetch 
        git checkout my-feature-branch 
        git merge origin/master
    

提交回复
热议问题