Make an existing Git branch track a remote branch?

前端 未结 22 3145
执念已碎
执念已碎 2020-11-21 07:16

I know how to make a new branch that tracks remote branches, but how do I make an existing branch track a remote branch?

I know I can just edit the

22条回答
  •  不知归路
    2020-11-21 08:04

    For creating new branch, we could use following command

     git checkout --track -b example origin/example 
    For the already created branch to create link between remote then from that branch use below command

     git branch -u origin/remote-branch-name

提交回复
热议问题