Git Hub Clone All Branches At Once

后端 未结 7 1066
时光取名叫无心
时光取名叫无心 2020-12-07 12:19

I\'m trying to clone an entire repository onto my machine using linux. I used

git clone    

I then went into the folder where i

7条回答
  •  攒了一身酷
    2020-12-07 12:49

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

    After cloning the repo, run $ cd myproject

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

    $ git branch -a
    * master
      remotes/origin/HEAD
      remotes/origin/master
      remotes/origin/v1.0-stable
      remotes/origin/experimental
    

    If you want to work on remote branch, you'll need to create a local tracking branch:

    $ git checkout -b experimental origin/experimental
    

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

    $ git branch
    

    The output will like this;

    *experimental
    master
    some branch2
    some branch3 
    

    Notice the * sign that denotes the current branch.

提交回复
热议问题