clone 某个分支:
git clone -b dev5 https://git.coding.net/aiyongbao/tradepc.git
clone 所有分支:
git clone https://git.coding.net/aiyongbao/tradepc.git
git branch -r
git checkout dev5
http://blog.csdn.net/xqs83/article/details/7382074/
git clone默认会把远程仓库整个给clone下来;
但只会在本地默认创建一个master分支
如果远程还有其他的分支,此时用git branch -a查看所有分支:
- * master
- remotes/origin/HEAD -> origin/master
- remotes/origin/master
- remotes/origin/python_mail.skin
- remotes/origin/udisk
- remotes/origin/vip
能看到远程的所有的分支,如remotes/origin/python_mail.skin
可以使用checkout命令来把远程分支取到本地,并自动建立tracking
- $ git checkout -b python_mail.skin origin/python_mail.skin
- Branch python_mail.skin set up to track remote branch python_mail.skin from origin
- Switched to a new branch 'python_mail.skin'
或者使用-t参数,它默认会在本地建立一个和远程分支名字一样的分支
折叠展开复制代码
- $ git checkout -t origin/python_mail.skin