Created
July 27, 2020 18:56
-
-
Save celsobessa/6ed982a4a7ed0e712f39c94eb27e6c63 to your computer and use it in GitHub Desktop.
Track, fetch and pull all remote branches on a remote GIT repository
This file contains 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
# Track, fetch and pull all remote branches on a remote GIT repository | |
# Source: https://stackoverflow.com/questions/10312521/how-to-fetch-all-git-branches/10312587#10312587 | |
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