[转]git clone 克隆所有分支

作者:

,

如下:

 1. #!/bin/bash 
 2. 
 3. #Whenever you clone a repo, you do not clone all of its branches by default. 
 4. #If you wish to do so, use the following script: 
 
 5. 
 
 6. for  branch  in  `git branch  -a  | grep remotes | grep -v HEAD | grep -v master `;  do 
 7.    git branch --track  ${branch#remotes/origin/} $branch 
 8. done

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注