How do I check out a remote Git branch?

后端 未结 30 2477
灰色年华
灰色年华 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:41

    Use:

    git checkout -b  /
    

    Other answers do not work with modern Git in my benign case. You might need to pull first if the remote branch is new, but I haven't checked that case.

提交回复
热议问题