Skip to content

Instantly share code, notes, and snippets.

@d6rkaiz
Created Jul 22, 2013
Embed
What would you like to do?
gitでリモートブランチをすべて取得するシェルスクリプト ref: http://qiita.com/d6rkaiz/items/e14aaf63ecd8aa9f715b
#!/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