Skip to content

Instantly share code, notes, and snippets.

@dannyfallon
Created April 23, 2012 14:03
Show Gist options
  • Save dannyfallon/2471083 to your computer and use it in GitHub Desktop.
Save dannyfallon/2471083 to your computer and use it in GitHub Desktop.
Remote branch fetch & track
Blatantly stolen from stack overflow, copy the below command into a terminal and run it
remote=origin ; for brname in `git branch -r | grep $remote | grep -v master | grep -v HEAD | awk '{gsub(/[^\/]+\//,"",$1); print $1}'`; do git branch --set-upstream $brname $remote/$brname ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment