How to rebase local branch with remote master

后端 未结 7 1272
北海茫月
北海茫月 2020-11-28 17:03

I have a cloned project from a master branch from remote repository remote_repo. I create a new branch and I commit to that branch. Other programmers pushed to

7条回答
  •  迷失自我
    2020-11-28 17:35

    1.Update Master first...

    git checkout [master branch]
    git pull [master branch]
    

    2.Now rebase source-branch with master branch

    git checkout [source branch]
    git rebase [master branch]
    git pull [source branch] (remote/source branch)
    git push [source branch]
    

    IF source branch does not yet exist on remote then do:

    git push -u origin [source branch]
    

    "et voila..."

提交回复
热议问题