How to clone all remote branches in Git?

后端 未结 30 2116
情话喂你
情话喂你 2020-11-22 01:08

I have a master and a development branch, both pushed to GitHub. I\'ve cloned, pulled, and fetched, but I re

30条回答
  •  广开言路
    2020-11-22 01:45

    This isn't too much complicated, very simple and straight forward steps are as follows;

    git fetch origin This will bring all the remote branches to your local.

    git branch -a This will show you all the remote branches.

    git checkout --track origin/

    Verify whether you are in the desired branch by the following command;

    git branch
    

    The output will like this;

    *your current branch 
    some branch2
    some branch3 
    

    Notice the * sign that denotes the current branch.

提交回复
热议问题