Created
June 3, 2015 07:45
-
-
Save ferstar/b3fe90cebf939e4fb903 to your computer and use it in GitHub Desktop.
Clone all remote branches with Git
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# from http://stackoverflow.com/questions/67699/clone-all-remote-branches-with-git | |
# usage: sh -x pull_all.sh | |
# 在你的git目录下执行此脚本即可 | |
for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master`; do | |
git branch --track ${branch##*/} $branch | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment