Skip to content

Instantly share code, notes, and snippets.

@d6rkaiz
Created July 22, 2013 09:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save d6rkaiz/6052563 to your computer and use it in GitHub Desktop.
Save d6rkaiz/6052563 to your computer and use it in GitHub Desktop.
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