clone remote Git repository with branches
If you git clone
a remote repository that has branches it just creates the default branch by default. You will need to force the creation of a specific branch using:
git checkout -b test origin/test
which will clone the branch and checkout
Written by Sergi Meseguer
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Branches
Authors
![](https://coderwall-assets-0.s3.amazonaws.com/uploads/user/avatar/25824/1900150_10203074354438338_1015529188_n.jpg)
filipekiss
5.435K
![](https://coderwall-assets-0.s3.amazonaws.com/uploads/user/avatar/28243/175656c5ee4c4e328e91103078c57aa5.jpeg)
zigotica
2.989K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#