When I cloned a remote repository, I used the following command-
git clone -b mybranch --single-branch git://sub.domain.com/repo.git
After
git branch -l
shows you local branches. You want remote branches, so try git branch -r
. When you see the branch you want, you can automatically create and checkout a local branch tracking the given remote branch with git checkout
.
For example, if your git branch -r
shows a branch you want called origin/my-feature
, just do
$ git checkout my-feature