Created
January 6, 2026 08:31
-
-
Save GeroZayas/3bbf59f07f579d4956816761f91456e6 to your computer and use it in GitHub Desktop.
Fetch and Pull All Git Branches
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://stackoverflow.com/questions/10312521/how-do-i-fetch-all-git-branches | |
| git branch -r \ | |
| | grep -v '\->' \ | |
| | sed "s,\x1B\[[0-9;]*[a-zA-Z],,g" \ | |
| | 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