Skip to content

Instantly share code, notes, and snippets.

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 scootcho/fc4359de1ed0c4e2bc4405e50823538c to your computer and use it in GitHub Desktop.
Save scootcho/fc4359de1ed0c4e2bc4405e50823538c to your computer and use it in GitHub Desktop.
Git checkout all remote branches
#!/bin/bash
remote=origin ; for brname in `git branch -r | grep $remote | grep -v /master | grep -v /HEAD | awk '{gsub(/^[^\/]+\//,"",$1); print $1}'`; do git branch --track $brname $remote/$brname || true; done 2>/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment