Track a new remote branch created on GitHub

后端 未结 4 1681
滥情空心
滥情空心 2020-12-22 14:43

I have already got a local master branch tracking the remote master branch of a github project. Now, a collaborator of mine has created a new branch in the same project, and

4条回答
  •  臣服心动
    2020-12-22 15:11

    git fetch
    git branch --track branch-name origin/branch-name
    

    First command makes sure you have remote branch in local repository. Second command creates local branch which tracks remote branch. It assumes that your remote name is origin and branch name is branch-name.

    --track option is enabled by default for remote branches and you can omit it.

提交回复
热议问题