Skip to content

Instantly share code, notes, and snippets.

@d4rkd0s
Created August 31, 2021 02:23
Show Gist options
  • Save d4rkd0s/e020ed91ff5b785d5c5cab5e04afa6cc to your computer and use it in GitHub Desktop.
Save d4rkd0s/e020ed91ff5b785d5c5cab5e04afa6cc to your computer and use it in GitHub Desktop.
Pull all branches from a git repo's remote origin
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment