Skip to content

Instantly share code, notes, and snippets.

@asolera
Last active April 7, 2021 18:46
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 asolera/02279b837266f4ddc16d25aefe1bba8a to your computer and use it in GitHub Desktop.
Save asolera/02279b837266f4ddc16d25aefe1bba8a to your computer and use it in GitHub Desktop.
Git fetch all remote branches to local machine
#!/bin/bash
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