How do I check out a remote Git branch?

后端 未结 30 2014
灰色年华
灰色年华 2020-11-22 00:12

Somebody pushed a branch called test with git push origin test to a shared repository. I can see the branch with git branch -r.

<
30条回答
  •  忘了有多久
    2020-11-22 00:35

    You can try

    git fetch remote
    git checkout --track -b local_branch_name origin/branch_name
    

    or

    git fetch
    git checkout -b local_branch_name origin/branch_name
    

提交回复
热议问题