Git Switching branch

后端 未结 2 2036
滥情空心
滥情空心 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.

    0 讨论(0)
  • 2021-02-06 03:27
    git fetch C
    git checkout C/stable-branch
    git checkout -b myCopy
    

    Then myCopy is a local (copied) branch of C's stable one.

    0 讨论(0)
提交回复
热议问题