Skip to content

Instantly share code, notes, and snippets.

@oscarruesga
Last active August 18, 2016 11:13
Show Gist options
  • Select an option

  • Save oscarruesga/afcc7af36099eec91f3c24da05be184b to your computer and use it in GitHub Desktop.

Select an option

Save oscarruesga/afcc7af36099eec91f3c24da05be184b to your computer and use it in GitHub Desktop.
Get all branches from a remote git repository
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