Git Switching branch

后端 未结 2 2033
滥情空心
滥情空心 2021-02-06 02:37

There is somthing I don\'t get yet with git. It is branch. So let say that I have a local repository A which I clone from a remote one B. So now

2条回答
  •  隐瞒了意图╮
    2021-02-06 03:22

    In two lines:
    git fetch C
    git checkout -b myCopy -t C/stable-branch

    myCopy is now a local branch of C/stable-branch, and is tracking it, so you can do git push and git pull without a refspec.

提交回复
热议问题