How to push from one branch to another and checkout?

后端 未结 1 759
眼角桃花
眼角桃花 2021-01-30 03:05

I am trying to implement the setup outlined here http://toroid.org/ams/git-website-howto but with one difference. On my local repository I want to use a branch different to mast

1条回答
  •  日久生厌
    2021-01-30 03:32

    If the local branch is called "demo" and you want to push to branch called "master" on the remote called "web", then do the following:

    git push web demo:master
    

    If you want to merge from the "master" branch on the remote "web" into your current branch, you can do the following:

    git fetch web
    git merge web/master
    

    0 讨论(0)
提交回复
热议问题