Checkout branch on different remote

前端 未结 3 842
难免孤独
难免孤独 2021-02-06 23:22

I have a repo that has another remote upstream besides origin. I can do git checkout origin/master, but when I run git checkout upst

3条回答
  •  悲哀的现实
    2021-02-07 00:16

    If you just added the remote, you'll need to fetch it so that Git knows which branches are available:

    git fetch upstream master
    

    After this you can do

    git checkout upstream/master
    

    without any issues.

提交回复
热议问题