git clone gihub项目只有master分支问题解决
问题
当使用git clone把github项目克隆到本地时,输入git branch -a,发现只有master分支(其他分支显示为remote),如果想看别的分支怎么办?
解决方法
使用checkout -b --track 下载分支;
git checkout -b <branch> --track <remote>/<branch>
# Switched to a new branch 'lab2'
# Branch 'lab2' set up to track remote branch 'lab2' from 'origin'.
git branch -a # 发现已经切换到新分支