Skip to content

Instantly share code, notes, and snippets.

Created Jul 22, 2013
What would you like to do?
gitでリモートブランチをすべて取得するシェルスクリプト ref:
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
git checkout master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment