Git: Merge a Remote branch locally

后端 未结 5 877
小蘑菇
小蘑菇 2020-12-02 03:58

I\'ve pulled all remote branches via git fetch --all. I can see the branch I\'d like to merge via git branch -a as remotes/origin/branchname. Probl

5条回答
  •  温柔的废话
    2020-12-02 04:10

    Maybe you want to track the remote branch with a local branch:

    1. Create a new local branch: git branch new-local-branch
    2. Set this newly created branch to track the remote branch: git branch --set-upstream-to=origin/remote-branch new-local-branch
    3. Enter into this branch: git checkout new-local-branch
    4. Pull all the contents of the remote branch into the local branch: git pull

提交回复
热议问题