Skip to content

Instantly share code, notes, and snippets.

@juanbrujo
Last active April 26, 2025 23:59
Show Gist options
  • Select an option

  • Save juanbrujo/99f3f545e9caff0aba94787768eed9dc to your computer and use it in GitHub Desktop.

Select an option

Save juanbrujo/99f3f545e9caff0aba94787768eed9dc to your computer and use it in GitHub Desktop.
Fetch all remote branches to local
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all
# https://stackoverflow.com/questions/10312521/how-to-fetch-all-git-branches
@freddavis980
Copy link

This code snippet for fetching remote branches to local is super handy! 2048

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment