Skip to content

Instantly share code, notes, and snippets.

@SyllaJay
Created July 18, 2016 01:56
Show Gist options
  • Save SyllaJay/5e51f6820d97f94c7d04802f6478f8f5 to your computer and use it in GitHub Desktop.
Save SyllaJay/5e51f6820d97f94c7d04802f6478f8f5 to your computer and use it in GitHub Desktop.
#!/bin/bash
# for remote in `git branch -r | grep -v /HEAD`; do git checkout --track $remote ; done
# for remote in `git branch -r `; do git branch --track $remote; done
ORIGIN=origin
for remote in `git branch -r | grep -v /HEAD`;do
local=${remote#"${ORIGIN}/"}
echo "git branch --track ${local} ${remote}"
git branch --track ${local} ${remote}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment