git clone 某个分支或者所有分支

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查看所有分支:

  1. * master   
  2. remotes/origin/HEAD -> origin/master  
  3. remotes/origin/master   
  4. remotes/origin/python_mail.skin   
  5. remotes/origin/udisk   
  6. remotes/origin/vip

能看到远程的所有的分支,如remotes/origin/python_mail.skin 
可以使用checkout命令来把远程分支取到本地,并自动建立tracking

  1. $ git checkout -b python_mail.skin origin/python_mail.skin
  2. Branch python_mail.skin set up to track remote branch python_mail.skin from origin
  3. Switched to a new branch 'python_mail.skin'

或者使用-t参数,它默认会在本地建立一个和远程分支名字一样的分支
折叠展开复制代码

  1. $ git checkout -t origin/python_mail.skin
原文地址:https://www.cnblogs.com/bluestorm/p/7380141.html