Created
July 22, 2013 09:27
-
-
Save d6rkaiz/6052563 to your computer and use it in GitHub Desktop.
gitでリモートブランチをすべて取得するシェルスクリプト ref: http://qiita.com/d6rkaiz/items/e14aaf63ecd8aa9f715b
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 | |
for remote_branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master`; do | |
remote_name="$(echo -n "$remote_branch" | cut -d/ -f2)" | |
branch_name="$(echo -n "$remote_branch" | cut -d/ -f3)" | |
git checkout -b $branch_name $remote_name/$branch_name | |
done | |
git checkout master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment