Skip to content

Instantly share code, notes, and snippets.

@c4milo
Created March 21, 2015 17:37
Show Gist options
  • Save c4milo/b3d5fc6b48e75277a958 to your computer and use it in GitHub Desktop.
Save c4milo/b3d5fc6b48e75277a958 to your computer and use it in GitHub Desktop.
#!/bin/bash
for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master`; do
name=`echo "$branch" | sed 's|remotes/origin/||'`
git branch --track "${name}" "$branch"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment