Skip to content

Instantly share code, notes, and snippets.

@athurg
Created October 14, 2016 06:14
Show Gist options
  • Select an option

  • Save athurg/ff585df7290bb6d19b2d5e4a0edfdc4a to your computer and use it in GitHub Desktop.

Select an option

Save athurg/ff585df7290bb6d19b2d5e4a0edfdc4a to your computer and use it in GitHub Desktop.
Pull all branch to local and set track
#!/bin/sh
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment